[jboss-user] [EJB 3.0] - Re: persistence-context-ref always yields same object instan

henk53 do-not-reply at jboss.com
Tue Aug 18 07:21:03 EDT 2009


"jaikiran" wrote : anonymous wrote : Whether I do the JNDI lookup multiple times right after each other in the same method, or test what the JNDI lookup returns in multiple simultaneous requests, the result is always an object instance with the same ID (e.g. org.jboss.jpa.tx.TransactionScopedEntityManager at d78f1b). 
  | 
  | Hmm, i would have expected it to return different instances in the multiple simultaneous requests usecase.
  | 

Me too. What I more precisely did was the following simple test:

1) Put the simple above shown code in a ServletFilter I happened to have on my screen that requested the EM out of JNDI.
2) Added a break-point to it, requested a page being filtered, inspected the identity of the instance using the Eclipse debugger.
3) While the request thread was still being suspended, I did a new request (for the same page) in a second tab of the same browser.
4) Observed the break-point was being hit again, but now in another thread and confirmed that the identity of the instance was the same one as was returned for the currently suspended thread.

If there is anything else you'd like me to test, please let me know.

View the original post : http://www.jboss.org/index.html?module=bb&op=viewtopic&p=4250133#4250133

Reply to the post : http://www.jboss.org/index.html?module=bb&op=posting&mode=reply&p=4250133



More information about the jboss-user mailing list