[jboss-jira] [JBoss JIRA] (AS7-5331) @Resource UserTransaction should not be allowed in CMT beans

Eduardo Martins (JIRA) jira-events at lists.jboss.org
Fri Jan 25 09:17:47 EST 2013


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

Eduardo Martins edited comment on AS7-5331 at 1/25/13 9:15 AM:
---------------------------------------------------------------

Linked PR which replaces https://github.com/jbossas/jboss-as/pull/3213
                
      was (Author: emmartins):
    PR that replaces https://github.com/jbossas/jboss-as/pull/3213
                  
> @Resource UserTransaction should not be allowed in CMT beans
> ------------------------------------------------------------
>
>                 Key: AS7-5331
>                 URL: https://issues.jboss.org/browse/AS7-5331
>             Project: Application Server 7
>          Issue Type: Bug
>          Components: EJB, Transactions
>    Affects Versions: 7.1.2.Final (EAP)
>            Reporter: Dominik Pospisil
>            Assignee: jaikiran pai
>
> Currently, it seems then @Resource UserTransaction injection is allowed in CMT beans and injects
> container managed transaction. In AS/EAP5 this would throw an exception which I think is correct as 
> this violates EJB 3.0 & 3.1 specs.
> Section 16.12 of the EJB 3.1 specification says:
> The container must make the UserTransaction interface available to the enterprise beans that are
> allowed to use this interface (only session and message-driven beans with bean-managed transaction
> demarcation are allowed to use this interface) either through injection using the Resource annotation
> or in JNDI under the name java:comp/UserTransaction, in addition to through the EJBContext
> interface. The authenticationType and shareable elements of the Resource annotation
> must not be specified.
> In my interpretation the statement "only session and message-driven beans with bean-managed transaction
> demarcation are allowed to use this interface" would mean that other beans are prohibited to use this
> interface. Allowing such beans to use this interface is specification violation.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira


More information about the jboss-jira mailing list