Uploaded image for project: 'WildFly'
  1. WildFly
  2. WFLY-76

@Resource UserTransaction should not be allowed in CMT beans

    XMLWordPrintable

Details

    • Bug
    • Resolution: Done
    • Major
    • 8.0.0.Alpha1
    • None
    • EJB, Transactions
    • None

    Description

      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.

      Attachments

        Activity

          People

            emartins@redhat.com Eduardo Martins
            dpospisil Dominik Pospisil (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            6 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: