Uploaded image for project: 'ActiveMQ'
  1. ActiveMQ
  2. AMQ-7354

Transaction interleaving works incorrectly

    XMLWordPrintableJSON

    Details

    • Type: Bug
    • Status: Open
    • Priority: Major
    • Resolution: Unresolved
    • Affects Version/s: 5.15.10
    • Fix Version/s: None
    • Component/s: JMS client
    • Labels:
      None

      Description

      I'm doing these steps:

       Xid xid1, xid2;
       XASession session = ...;
       MessageConsumer consumer = ...;
       XAResource xaRes = session.getXAResource();xaRes.start(xid1, TMNOFLAGS);
       consumer.receive();
       xaRes.end(xid1, TMSUCCESS);
       // prepare the xid1, continue with xid2
       xaRes.prepare(xid1);
       xaRes.start(xid2);
       // receive one more item
       consumer.receive();
       // commit the first transaction
       xaRes.commit(xid1, false);

      The last `commit` should commit only the first received message. But it commits also the message received using the `xid2` transaction.

      As far as I can tell this is how it should behave according to JTA spec. That's why the `commit` method has the `Xid` argument: to tell which transaction are we committing. The `receive` method uses the transaction associated currently with the session. It also works correctly with ActiveMQ Artemis.

      See also http://activemq.2283324.n4.nabble.com/Transaction-interleaving-td4753653.html

        Attachments

          Activity

            People

            • Assignee:
              Unassigned
              Reporter:
              vilo Viliam Durina
            • Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

              • Created:
                Updated: