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

XA transaction fails to prepare commit

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Incomplete
    • 4.1.2, 5.1.0
    • NEEDS_REVIEW
    • JCA Container
    • None
    • Windows XP, glassfish v2 UR1

    • Regression

    Description

      I am trying to do a database update and send a message to ActiveMQ via JMS in a single XA transaction. When tha JTA transaction manager tries to prepare the commit I get the following in the ActiveMQ log and the transaction is rolled back.

      2008-03-12 11:09:01,713 [/127.0.0.1:2399] DEBUG TransportConnection - Setting up new connection: /127.0.0.1:2399
      2008-03-12 11:09:01,713 [/127.0.0.1:2399] DEBUG AbstractRegion - Adding consumer: ID:FE-Z2965-2033-1205312064755-0:30:-1:1
      2008-03-12 11:09:01,728 [/127.0.0.1:2399] DEBUG AMQMessageStore - Journalled transacted message add for: ID:FE-Z2965-2033-1205312064755-0:30:1:1:1, at: offset = 3213, file = 1, size = 557, type = 1
      2008-03-12 11:09:01,728 [/127.0.0.1:2399] DEBUG AbstractRegion - Removing consumer: ID:FE-Z2965-2033-1205312064755-0:30:-1:1
      2008-03-12 11:09:01,728 [/127.0.0.1:2399] DEBUG Service - Error occured while processing sync command: java.lang.NullPointerException: Context is null
      java.lang.NullPointerException: Context is null
      at org.apache.activemq.broker.TransportConnection.processPrepareTransaction(TransportConnection.java:375)
      at org.apache.activemq.command.TransactionInfo.visit(TransactionInfo.java:98)
      at org.apache.activemq.broker.TransportConnection.service(TransportConnection.java:291)
      at org.apache.activemq.broker.TransportConnection$1.onCommand(TransportConnection.java:181)
      at org.apache.activemq.transport.TransportFilter.onCommand(TransportFilter.java:68)
      at org.apache.activemq.transport.WireFormatNegotiator.onCommand(WireFormatNegotiator.java:134)
      at org.apache.activemq.transport.InactivityMonitor.onCommand(InactivityMonitor.java:204)
      at org.apache.activemq.transport.TransportSupport.doConsume(TransportSupport.java:84)
      at org.apache.activemq.transport.tcp.TcpTransport.doRun(TcpTransport.java:196)
      at org.apache.activemq.transport.tcp.TcpTransport.run(TcpTransport.java:183)
      at java.lang.Thread.run(Thread.java:595)
      2008-03-12 11:09:01,744 [/127.0.0.1:2399] DEBUG TransportConnection - Setting up new connection: /127.0.0.1:2399
      2008-03-12 11:09:01,744 [/127.0.0.1:2399] DEBUG AbstractRegion - Adding consumer: ID:FE-Z2965-2033-1205312064755-0:30:-1:2
      2008-03-12 11:09:01,760 [/127.0.0.1:2399] DEBUG XATransaction - XA Transaction rollback: XID:4871251:0f000000549135a246452d5a323936352c7365727665722c5033373030:46452d5a323936352c7365727665722c50333730302c01
      2008-03-12 11:09:01,760 [/127.0.0.1:2399] DEBUG AMQMessageStore - Transacted message add rollback for: ID:FE-Z2965-2033-1205312064755-0:30:1:1:1, at: offset = 3213, file = 1, size = 557, type = 1

      The problem seems to be that the current connection is unregistered from the org.apache.activemq.broker.TransportConnectionStateRegister once the message is written to the journal and no new connection is registered before the processPrepareTransaction invocation. However, I have no idea where to look in the code to fix this.

      Regards,
      Kai

      Attachments

        Activity

          People

            Unassigned Unassigned
            hudalla Kai Hudalla
            Votes:
            1 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: