Return-Path: Delivered-To: apmail-activemq-dev-archive@www.apache.org Received: (qmail 32554 invoked from network); 26 Apr 2010 15:19:50 -0000 Received: from unknown (HELO mail.apache.org) (140.211.11.3) by 140.211.11.9 with SMTP; 26 Apr 2010 15:19:50 -0000 Received: (qmail 74609 invoked by uid 500); 26 Apr 2010 15:19:49 -0000 Delivered-To: apmail-activemq-dev-archive@activemq.apache.org Received: (qmail 74583 invoked by uid 500); 26 Apr 2010 15:19:49 -0000 Mailing-List: contact dev-help@activemq.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@activemq.apache.org Delivered-To: mailing list dev@activemq.apache.org Received: (qmail 74575 invoked by uid 99); 26 Apr 2010 15:19:49 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 26 Apr 2010 15:19:49 +0000 X-ASF-Spam-Status: No, hits=-1348.1 required=10.0 tests=ALL_TRUSTED,AWL X-Spam-Check-By: apache.org Received: from [140.211.11.22] (HELO thor.apache.org) (140.211.11.22) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 26 Apr 2010 15:19:48 +0000 Received: from thor (localhost [127.0.0.1]) by thor.apache.org (8.13.8+Sun/8.13.8) with ESMTP id o3QFJSLZ009843 for ; Mon, 26 Apr 2010 15:19:28 GMT Message-ID: <3711840.4531272295168214.JavaMail.jira@thor> Date: Mon, 26 Apr 2010 11:19:28 -0400 (EDT) From: "Gary Tully (JIRA)" To: dev@activemq.apache.org Subject: [jira] Commented: (AMQ-2659) JMSException incorrectly thrown when using XAConnection/XASession outside a transaction In-Reply-To: <49335222.18341269016305678.JavaMail.jira@brutus.apache.org> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: ae95407df07c98740808b2ef9da0087c [ https://issues.apache.org/activemq/browse/AMQ-2659?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=59101#action_59101 ] Gary Tully commented on AMQ-2659: --------------------------------- to speed up the process, it would help if there were a few unit tests that demonstrated the required behavior and don't break anything else. I think message receipt will be problematic as an XASession is always transacted w.r.t acks and without a transaction there will be no ack. btw: I think the change to getTransacted() will help with https://issues.apache.org/activemq/browse/AMQ-2712 which is good. > JMSException incorrectly thrown when using XAConnection/XASession outside a transaction > --------------------------------------------------------------------------------------- > > Key: AMQ-2659 > URL: https://issues.apache.org/activemq/browse/AMQ-2659 > Project: ActiveMQ > Issue Type: Bug > Affects Versions: 5.3.0 > Reporter: Eugene Rodos > > Currently, if one attempts to use an XAConnection (implemented by ActiveMQXAConnection) and consequently an XASession (implemented by ActiveMQXASession) outside a transaction, a JMSException is thrown. However, nowhere in the JMS Spec does it say that if an XAConnection/XASession is used, it _*must*_ be enlisted in a transaction. It is perfectly legal to _*not*_ start a transaction but still use the XA objects. > I propose that the following 2 methods in ActiveMQXASession be changed as follows to resolve this bug: > {noformat} > public boolean getTransacted() throws JMSException { > return getTransactionContext().isInXATransaction(); > } > /** > * This is called before transacted work is done by the session. > * XA transactions are controlled outside of the session so > * nothing has to be done here. The only reason for this method > * to be here is to override the parent. > */ > protected void doStartTransaction() { > } > {noformat} > \\ > The current version of these methods is as follows (for reference): > {noformat} > public boolean getTransacted() throws JMSException { > return true; > } > /** > * This is called before transacted work is done by > * the session. XA Work can only be done when this > * XA resource is associated with an Xid. > * > * @throws JMSException not associated with an Xid > */ > protected void doStartTransaction() throws JMSException { > if (!getTransactionContext().isInXATransaction()) { > throw new JMSException("Session's XAResource has not been enlisted in a distributed transaction."); > } > } > {noformat} -- This message is automatically generated by JIRA. - You can reply to this email to add a comment to the issue online.