Skip to main content



      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
Eclipse UserFriend
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
Eclipse UserFriend
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.
Previous Topic:DTYPE Generated on ManyToMany Join?
Next Topic:StoredProcedureCall RETURN nested table/array
Goto Forum:
  


Current Time: Fri Jul 25 20:52:09 EDT 2025

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

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

Back to the top