[jboss-jira] [JBoss JIRA] Commented: (JBAS-7218) ENC EM injection erroneously happens only once for web modules

Scott Marlow (JIRA) jira-events at lists.jboss.org
Tue Jan 18 13:27:49 EST 2011


    [ https://issues.jboss.org/browse/JBAS-7218?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12576339#comment-12576339 ] 

Scott Marlow commented on JBAS-7218:
------------------------------------

https://hudson.jboss.org/hudson/job/JBoss-AS-6.0.x/lastSuccessfulBuild/artifact/JBossAS_6_0/build/target/jboss-6.0.x.zip contains an AS build (from latest 6.x trunk sources).  Please try to reproduce the issue if you can.

> ENC EM injection erroneously happens only once for web modules
> --------------------------------------------------------------
>
>                 Key: JBAS-7218
>                 URL: https://issues.jboss.org/browse/JBAS-7218
>             Project: JBoss Application Server
>          Issue Type: Bug
>      Security Level: Public(Everyone can see) 
>    Affects Versions: JBossAS-5.1.0.GA
>         Environment: Observed problem on Mac OS X 10.5.7 and Debian Lenny 64 bits using JDK 6 
>            Reporter: henk de boer
>            Assignee: Scott Marlow
>             Fix For: 6.0.1
>
>
> Using a persistence-context-ref element in the web.xml of a web module, it appears that this causes an EntityManager instance to be injected only once into the ENC of this component.
> However, the EJB 3.0 spec states in section 16.2.1:
> "In general, lookups of objects in the JNDI java: namespace are required to return a new instance of the requested object every time."
> So the observed behavior seems to violate the spec. In addition, this is particularly troublesome since an EntityManager is explicitly not thread-safe. Using the same EM instance for simultaneous requests therefor doesn't work. 
> Of course there are several other methods to obtain an EM reference, for instance binding an EM factory directly to JNDI and using that to obtain the reference.

-- 
This message is automatically generated by JIRA.
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        


More information about the jboss-jira mailing list