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 385E111BE2 for ; Mon, 22 Sep 2014 13:37:34 +0000 (UTC) Received: (qmail 3594 invoked by uid 500); 22 Sep 2014 13:37:34 -0000 Delivered-To: apmail-aries-dev-archive@aries.apache.org Received: (qmail 3554 invoked by uid 500); 22 Sep 2014 13:37: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 3377 invoked by uid 99); 22 Sep 2014 13:37:34 -0000 Received: from arcas.apache.org (HELO arcas.apache.org) (140.211.11.28) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 22 Sep 2014 13:37:34 +0000 Date: Mon, 22 Sep 2014 13:37:33 +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] [Created] (ARIES-1246) ConnectionManagerFactory does not honor aries.xa.name service property MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 J=C3=B6rn Gersdorf created ARIES-1246: ------------------------------------ Summary: ConnectionManagerFactory does not honor aries.xa.name= service property Key: ARIES-1246 URL: https://issues.apache.org/jira/browse/ARIES-1246 Project: Aries Issue Type: Bug Components: Transaction Affects Versions: 1.0.1-SNAPSHOT Environment: JBoss Fuse 6.1, aries-transaction/1.0.1-redhat-610379= , geronimo-connector/3.0 Reporter: J=C3=B6rn Gersdorf I=C2=B4m running JBoss Fuse 6.1 (which includes org.apache.aries.transactio= n.jdbc/1.0.1-redhat-610379 as well as geronimo-connector/3.0). When using XA auto-enlisting it seems that {{org.apache.aries.transaction.j= dbc.internal.ConnectionManagerFactory}} does not use the service property {= {aries.xa.name}} as a name; instead it uses {{getClass().getName()}}: {noformat} if (connectionManager =3D=3D null) { // Instantiate the Geronimo Connection Manager connectionManager =3D new GenericConnectionManager( transactionSupport, poolingSupport, subjectSource, connectionTracker, transactionManager, managedConnectionFactory, getClass().getName(), // <-- this may be wrong getClass().getClassLoader()); {noformat} This leads to problems in {{org.apache.geronimo.transaction.manager.Rollbac= kTask}} when looking up the {{NamedXAResourceFactory}} in case of {{XAExcep= tion.XAER_RMFAIL}}: {noformat} } else if (e.errorCode =3D=3D XAException.XAER_RMFAIL |= | e.errorCode =3D=3D XAException.XAER_RMERR) { //refresh the xa resource from the NamedXAResourceF= actory if (manager.getCommitter() instanceof NamedXAResour= ce) { String xaResourceName =3D manager.getResourceNa= me(); // <-- this will resolve to aries.xa.name=C2=B4s property value NamedXAResourceFactory namedXAResourceFactory = =3D txManager.getNamedXAResourceFactory(xaResourceName); // <-- this will b= e null since the factory has been registered under "org.apache.aries.transa= ction.jdbc.internal.ConnectionManagerFactory"=20 {noformat}=20 Now the problem is that {{manager.getResourceName()}} resolves to the value= of the service property {{aries.xa.name}}, but {{txManager.getNamedXAReso= urceFactory(xaResourceName)}} will return null since {{ConnectionManagerFac= tory}} registered the {{GenericConnectionManager}} under its fully qualifie= d class name ({{org.apache.aries.transaction.jdbc.internal.ConnectionManage= rFactory}}). Result in my case is an endless loop of RollbackTasks since the NamedXAReso= urceFactory will never be found. Relevant stack trace of registration: {noformat} =09=09Daemon Thread [FelixStartLevel] (Suspended (breakpoint at line 36 in = XAResourceInsertionInterceptor))=09 =09=09=09owns: AtomicBoolean (id=3D205)=09 =09=09=09XAResourceInsertionInterceptor.(ConnectionInterceptor, Strin= g) line: 36=09 =09=09=09XATransactions.addXAResourceInsertionInterceptor(ConnectionInterce= ptor, String) line: 61=09 =09=09=09GenericConnectionManager$InterceptorsImpl.(TransactionSuppor= t, PoolingSupport, SubjectSource, String, ConnectionTracker, TransactionMan= ager, ManagedConnectionFactory, ClassLoader) line: 129=09 =09=09=09GenericConnectionManager.(TransactionSupport, PoolingSupport= , SubjectSource, ConnectionTracker, RecoverableTransactionManager, ManagedC= onnectionFactory, String, ClassLoader) line: 67=09 =09=09=09org.apache.aries.transaction.jdbc.internal.ConnectionManagerFactor= y.init() line: 140=09 =09=09=09org.apache.aries.transaction.jdbc.internal.ManagedDataSourceFactor= y.register() line: 116=09 =09=09=09Activator.addingService(ServiceReference) line: 95=09 {noformat} -- This message was sent by Atlassian JIRA (v6.3.4#6332)