Hi,
My
EJB client program needs to call EJB (stateless session bean) with one username and then the same EJB again, but with another user name.
At client side, I created new InitialContext(Envionment), where the Environment is a property which contains user name. And, in my EJB, I store the sessionContext as a member variable in setSessionContext() callback.
However, I noticed that when I call EJB for the 2nd time, the user name returned from sessionContext.getCallerPrincipal() is still the 1st user name.
In addition, even though the EJB is called twice, setSessionContext() is called only once.
Is there a way to make sessionContext reflect user credential as they change at run-time?
Thanks.
Yan