Skip to main content


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 15:44 Go to next message
Florian Reiser is currently offline Florian ReiserFriend
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 16:11 Go to previous message
James Sutherland is currently offline James SutherlandFriend
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: Tue Apr 23 16:30:32 GMT 2024

Powered by FUDForum. Page generated in 0.03433 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top