activemq-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Alexei Akimov (JIRA)" <j...@apache.org>
Subject [jira] Reopened: (AMQ-1617) XA transaction fails to prepare commit
Date Tue, 24 Jun 2008 05:53:00 GMT

     [ https://issues.apache.org/activemq/browse/AMQ-1617?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]

Alexei Akimov reopened AMQ-1617:
--------------------------------

    Regression: [Regression]

I do think this is an ActiveMQ bug. The mentioned behaviour violates Java Connector Architecture
(JCA) and Java Transaction Architecture (JTA) specifications. XAResource must have opportunity
to commit one transaction being already used in another one. In a typical scenario described
in specs managed connection is cleaned up before the transaction commits. Being cleaned the
connection is returned to pool and can be supplied to another client. In the current ActiveMQ
implementation this leads to invalid connection context when the first transaction commits.
XAResource implementatiom must not depend on the connection client specific data which is
cleaned before returning the connection to pool.

Hera are the references to specs:
1. Scenario: Connection Close and JTA Transactional Cleanup (JCA 7.6.5)
2. Scenario: Connection Event Notifications and Connection Close (JCA 6.8.3)
3. Resource Sharing (JTA 3.6.4)

Best regards
Alexei Akimov

> XA transaction fails to prepare commit
> --------------------------------------
>
>                 Key: AMQ-1617
>                 URL: https://issues.apache.org/activemq/browse/AMQ-1617
>             Project: ActiveMQ
>          Issue Type: Bug
>          Components: Broker, Transport
>    Affects Versions: 4.1.2, 5.1.0
>         Environment: Windows XP, glassfish v2 UR1
>            Reporter: Kai Hudalla
>
> 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

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


Mime
View raw message