Return-Path: X-Original-To: apmail-aries-dev-archive@www.apache.org Delivered-To: apmail-aries-dev-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 829CA17B92 for ; Tue, 14 Oct 2014 08:26:39 +0000 (UTC) Received: (qmail 41748 invoked by uid 500); 14 Oct 2014 08:26:34 -0000 Delivered-To: apmail-aries-dev-archive@aries.apache.org Received: (qmail 41706 invoked by uid 500); 14 Oct 2014 08:26:34 -0000 Mailing-List: contact dev-help@aries.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@aries.apache.org Delivered-To: mailing list dev@aries.apache.org Received: (qmail 41607 invoked by uid 99); 14 Oct 2014 08:26:34 -0000 Received: from arcas.apache.org (HELO arcas.apache.org) (140.211.11.28) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 14 Oct 2014 08:26:34 +0000 Date: Tue, 14 Oct 2014 08:26:34 +0000 (UTC) From: =?utf-8?Q?J=C3=B6rn_Gersdorf_=28JIRA=29?= To: dev@aries.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Commented] (ARIES-1265) Aries Transactions: Transaction Enlisting failing for multiple OracleXADataSources/Connections MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 [ https://issues.apache.org/jira/browse/ARIES-1265?page=3Dcom.atlassian= .jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=3D1417= 0659#comment-14170659 ]=20 J=C3=B6rn Gersdorf commented on ARIES-1265: -------------------------------------- Additional information: granting {{FORCE ANY TRANSACTION}} does not help ei= ther, in that case I get an {{ORA-25351}} ("transaction currently in use"). > Aries Transactions: Transaction Enlisting failing for multiple OracleXADa= taSources/Connections > -------------------------------------------------------------------------= --------------------- > > Key: ARIES-1265 > URL: https://issues.apache.org/jira/browse/ARIES-1265 > Project: Aries > Issue Type: Bug > Components: Transaction > Environment: JBoss Fuse 6.1, Apache Karaf 2.3.0, Aries Transactio= n 1.0.x, Oracle 11.2 > Reporter: J=C3=B6rn Gersdorf > Attachments: test-geronimo-tx.zip > > > When using multiple Oracle XADataSources (and thus XAConnections) within = the same global XA transaction, Apache Aries/Geronimo fails with ORA-24798 = (Cannot resume distributed transaction branch on another instance). Don=C2= =B4t be fooled by the "on another instance": actually I`m connecting to the= same Oracle instance (which is not behind a RAC). > h3. Scenarios > I tested three scenarios, always using two DataSources within one global = XA transaction: > 1. Use two DataSources, each with same user principal > 2. Use two DataSources, each with same user principal > 3. Use one DataSource > In all three scenarios I do the following: > 1. txManager.begin() > 2. con1 :=3D Get connection from DataSource1 > 3. SELECT * from DUAL@con1 > 4. con2 :=3D Get connection from DataSource2 > 5. SELECT * from DUAL@con2 > 6. txManager.begin() > Scenario (two different DataSources) 1 and 2 fail with ORA-24798. Scenari= o 3 (one DataSource for both connections) does not fail, but this is only d= ue to {{org.apache.aries.transaction.jdbc.internal.XADatasourceEnlistingWra= pper}} caching connections per (DataSource, Transaction) pair: as a result = con1 =3D=3D con2 in this scenario. > h3. Problem description > The root cause is how {{javax.transaction.XAResource#isSameRM(XAResource)= }} is used in {{org.apache.geronimo.transaction.manager.TransactionImpl#enl= istResource(XAResource)}}. If there is already an {{XAResource}} enlisted i= n the current transaction running on the same RM as the {{XAResource}} to b= e enlisted (according to {{isSameRM}}) then Aries/Geronimo tries to {{TMJOI= N}} the branch. > Now, this is exactly the point where Oracle fails with {{ORA-24798}}. > Frankie Viet has an excellent discussion about the whole issue at http://= frankkieviet.blogspot.com/2010/01/how-to-enlist-and-delist-xa-resources.htm= l. In summary it says that the sequence > {noformat} > 1: // MULTIPLE ACTIVE > 2: r1.start(xid, TMNOFLAGS); > 3: r1.isSameRM(r2); // returns true > 4: r2.start(xid, TMJOIN); > 5: r2.end(xid, TMSUCCESS); > 6: r1.end(xid, TMSUCCESS); > 7: r1.commit(xid, true);=20 > {noformat} > is neither working on Oracle nor Websphere MQ (and other commercial syste= ms). > Instead that link suggests the following sequence working in most cases: > {noformat} > 1: // SINGLE ACTIVE 2 > 2: r1.start(xid, TMNOFLAGS); > 3: r1.isSameRM(r2); // should return true > 4: ... // use r1 > 5: r1.end(xid, TMSUCCESS); > 6: r2.start(xid, TMJOIN); > 7: ... // use r2 > 8: r2.end(xid, TMSUCCESS); > 9: r1.start(xid, TMJOIN); > 10: ... // use r1 again > 11: r1.end(xid, TMSUCESS); > 12: r1.commit(xid, true); > {noformat} -- This message was sent by Atlassian JIRA (v6.3.4#6332)