Questions tagged [sessioncontext]

The `SessionContext` interface as a part of the `javax.ejb` package provides access to the run-time session context that the EJB container provides for a session bean instance.

The SessionContext interface as a part of the javax.ejb package provides access to the run-time session context that the EJB container provides for a session bean instance. The container passes the SessionContext interface to an EJB instance after the instance has been created. The session context remains associated with the EJB instance for the lifetime of the instance.

26 questions
6
votes
1 answer

Finding out what EJB view was used

Assume I have an EJB defining two views: Local business, Remote business. Both interfaces share the same method signatures, so it's like: public interface MyBusinessCommon { void myMethod(Object o); } @Local public interface MyBusinessLocal…
Piotr Nowicki
  • 17,914
  • 8
  • 63
  • 82
2
votes
0 answers

SQL Server Profiler: How to filter on a Session Context key's value?

I am using SQL Server 2016 in Windows. There are multiple connections to SQL Server and a database. Each of those connections have a Session Context Key 'CustomerId' and a specific value. So for example there are 3 connections: Connection # 1 has…
2
votes
0 answers

Arquillian Glassfish embedded - NameNotFoundException

I am trying to create integration tests for my application using arquillian but I am currently having issues regarding the use of @Resource SessionContext. Here is my config: My pom.xml arquillian dependecies: . . .
2
votes
2 answers

Mock injected SessionContext

I'm injecting SessionContext as a resource to an EJB (implementing container managed transactions): @Stateless(name = "XXX", mappedName = "PPP-MMM-CCC") @TransactionManagement(value=TransactionManagementType.CONTAINER) public class Xxx implements…
Amir Keibi
  • 1,991
  • 28
  • 45
1
vote
1 answer

Cannot set/get SQL session_context in .NET C#

I had this working a few months ago but i cant read back a session variable set in code but i can in the query analyzer.. this C# code sets the variable String.Format("EXEC sp_set_session_context N'TENANTID', '{0}'", tenantId);…
ink169
  • 23
  • 5
1
vote
1 answer

Why does Subject.doAs return the principal based on the logged in user instead of the switched subject?

I am trying to convert an existing api from a web application that was previously deployed in bea weblogic. I need to deploy this application now in JBoss EAP 7. In my user login code, I am doing servlet authentication like so: HttpServletRequest…
1
vote
0 answers

sessionContext.getCallerPrincipal().getName() always returns "anonymous"

I am working on a web project which contains EJB components and is deployed in JBoss EAP 7.0.7. Some of the EJBs are called from a standalone client application. The problem is although the authentication seems to work fine, the principal is not…
1
vote
1 answer

SessionContext is always null in Session-Bean called from a Servlet

My job is to write kind of a webservice adapter using a Servlet which then calls an adapter EJB (SOAP webservice) which in turn calls the existing service methods (also EJBs). The existing architecture is based on EJB 2.0, which I can't change for…
1
vote
0 answers

EJB and isCallerInRole: wrong output with multi-roles check in SessionContext

I have a problem with isCallerInRole method from the SessionContext. The application run on Glassfish 2.1 and uses JDK6. In the following class, I'm exposing two methods that ascertain if the current user has a specific role or not. In particular,…
mat_boy
  • 12,998
  • 22
  • 72
  • 116
1
vote
1 answer

initialize sessionContext and context

Can anyone please suggest to me how to initialize org.jboss.seam.contexts Context as well as session context inside IR? I need to do it for my testing purposes.
Niraj Dave
  • 117
  • 2
  • 10
1
vote
1 answer

Is it possible to get the SessionContext from JBoss without going through an EJB?

All the answers I read discuss the container injecting the SessionContext on the EJB itself, but what if I wanted to get at the current SessionContext without having an EJB?
user4903
0
votes
0 answers

Postgresql HA by Bitnami - Unable to get session context error when trying to create a db from a .NET app

I deployed Postgresql HA Helm Chart by Bitnami on my Kubernetes Cluster and did the configuration based on the provided configuration fields by the Helm chart. I'm getting an error when trying to create a db from a .NET app when using PgPool II's…
0
votes
0 answers

Can you programmatically switch between existing Session Contexts

I have multiple existing Stateful Session Beans. I want to use a new library/framework that instantiates objects (outside the container manager). This framework does not conceptually have 'sessions'. I'm trying to develop a proof of concept to route…
0
votes
0 answers

Changing the Default Database in a Stored Procedure at Runtime

I have a stored procedure in a database called DEV1 which exists in a Schema called BI. I am connecting with an ODBC connection that sets the default database of the session to a databased called DEV2. I am unable to modify the ODBC connection of…
0
votes
1 answer

What is the replacement of EJB SessionContext object in spring boot?

I am migrating an EJB project to Spring boot project. I have successfully replaced other annotations to the spring annotation, but havving problem with SessionContext object. My legacy code is bellow @Resource SessionContext sessionContext; ..... if…
mahfuj asif
  • 1,691
  • 1
  • 11
  • 32
1
2