-
Bug
-
Resolution: Unresolved
-
Major
-
trunk
-
Workaround Exists
-
1) I have Stateless EJBs with the EJBContext defined as a @Resource and a method getting the caller's name:
public class MyBean {
@Resource
private SessionContext ejbSession = null;
private String getCallerName()
{ return this.ejbSession.getCallerPrincipal().getName(); }}
2) My client always always calls in authenticated mode
3) I execute my client once and everything goes fine
4) I execute it other times, but there, one in a while, I don't get my authenticated user but the one from a preious call.
I tracked that it was sometimes the same "EJBContextImpl" object from one call to the other. The first call to "getCallerPrincipal()" is cached, so when I use the same object the second time, it does not look for it but returns the value from a previous call.