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

henk53 do-not-reply at jboss.com
Mon Aug 24 18:07:32 EDT 2009


"jaikiran" wrote : Looking into the way this is handled, this appears to be an issue with the web layer where the ENC injections happen only once (during the start). Effectively, the EntityManager is injected once into the ENC of that component. The spec says:
  | 
  | anonymous wrote :      In general, lookups of objects in the JNDI java: namespace are required to return a new instance of the requested object every time. Exceptions are allowed for the following:
  |   | 
  |   |   The container knows the object is immutable (for example, objects of type java.lang.String), or knows that the application cannot change the state of the object.
  |   | 
  |   |   The object is defined to be a singleton, such that only one instance of the object may exist in the JVM.
  |   | 
  |   |   The name used for the lookup is defined to return an instance of the object that might be shared. The name java:comp/ORB is such a name.
  |   | 
  | 
  | So this looks like a bug to me. Could you please create an issue in JBAS here https://jira.jboss.org/jira/browse/JBAS

Sure, no problem. Thanks for verifying.

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

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



More information about the jboss-user mailing list