Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » EclipseLink » Retrieving username from JBoss for db call setting application_context in Oracle
Retrieving username from JBoss for db call setting application_context in Oracle [message #642035] Mon, 29 November 2010 10:44 Go to next message
Florian Reiser is currently offline Florian Reiser
Messages: 25
Registered: July 2009
Junior Member
Hello,

I'm implementing VPD using an Oracle application_context.
For initializing it, I want to pass the username to oracle.

For this to happen, I have implemented a SessionEventListener which does the calls to the database.
Now my only problem is retrieving the username reliably.

If I retrieve the EJBContext via JNDI (all my db calls come from EJBs), then I sometimes get NullPointerExceptions stating, that the EJBContext is not available.

Are there more reliable ways?
How do you retrieve the username which is logged in ?

With kind regards

Florian Reiser
Re: Retrieving username from JBoss for db call setting application_context in Oracle [message #642765 is a reply to message #642035] Thu, 02 December 2010 11:11 Go to previous message
James Sutherland is currently offline James Sutherland
Messages: 1939
Registered: July 2009
Location: Ottawa, Canada
Senior Member

Where does your username come from?

You could try setting it in a thread local, or setting it as a EntityManager or EclipseLink Session property so it is accessible to the event.

Odd that the app server EJBContext would be null, when is it null vs not? What is the stack to the null-pointer.


James : Wiki : Book : Blog : Twitter
Previous Topic:DTYPE Generated on ManyToMany Join?
Next Topic:StoredProcedureCall RETURN nested table/array
Goto Forum:
  


Current Time: Sun Aug 31 04:42:11 EDT 2014

Powered by FUDForum. Page generated in 0.04813 seconds