Uploaded image for project: 'JBoss A-MQ'
  1. JBoss A-MQ
  2. ENTMQ-224

ER1: JMS TCKs violations: if connection is reused in EJB, second usage is out of transaction

    XMLWordPrintable

Details

    • Bug
    • Resolution: Done
    • Major
    • JBoss A-MQ 6.1
    • JBoss A-MQ 6.0
    • None
    • None

    Description

      In some TCK tests, there is Stateful EJB. In ejbCreate() method, there is connection created by connection factory, which was looked up in jndi. This connection is stored in the object and used later in other methods.

      Problem is, that by creating the connection, it's enlisted in XA transaction, when ejbCreate method ends, first transaction ends and org.apache.activemq.ra.LocalAndXATransaction field inManagedTx is set to false. When the connection is reused in other method call, inManagedTx is not set again to true and at the end of method, session created from this connection is rollbacked.

      It's not recommended to cache connections in JEE environment, because these resources are pooled on app server side (so no significant performance loss when created again), but it seems to be valid use case (at least TCKs use it).

      Attachments

        1. MDB_AR_TestEJB.java
          4 kB
        2. mdb_rec.zip
          151 kB
        3. module.xml
          0.6 kB
        4. standalone.xml
          18 kB
        5. tck-tx-test.tgz
          8 kB

        Issue Links

          Activity

            People

              gtully@redhat.com Gary Tully
              jsedlacek Jiri Sedlacek (Inactive)
              Votes:
              0 Vote for this issue
              Watchers:
              6 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: