aries-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Jörn Gersdorf (JIRA) <>
Subject [jira] [Created] (ARIES-1246) ConnectionManagerFactory does not honor service property
Date Mon, 22 Sep 2014 13:37:33 GMT
Jörn Gersdorf created ARIES-1246:

             Summary: ConnectionManagerFactory does not honor service property
                 Key: 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örn Gersdorf

I´m running JBoss Fuse 6.1 (which includes org.apache.aries.transaction.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.jdbc.internal.ConnectionManagerFactory}}
does not use the service property {{}} as a name; instead it uses {{getClass().getName()}}:

        if (connectionManager == null) {
            // Instantiate the Geronimo Connection Manager
            connectionManager = new GenericConnectionManager(
                    getClass().getName(), // <-- this may be wrong

This leads to problems in {{org.apache.geronimo.transaction.manager.RollbackTask}} when looking
up the {{NamedXAResourceFactory}} in case of {{XAException.XAER_RMFAIL}}:

                    } else if (e.errorCode == XAException.XAER_RMFAIL || e.errorCode == XAException.XAER_RMERR)
                        //refresh the xa resource from the NamedXAResourceFactory
                        if (manager.getCommitter() instanceof NamedXAResource) {
                            String xaResourceName = manager.getResourceName(); // <-- this
will resolve to´s property value
                            NamedXAResourceFactory namedXAResourceFactory = txManager.getNamedXAResourceFactory(xaResourceName);
// <-- this will be null since the factory has been registered under "org.apache.aries.transaction.jdbc.internal.ConnectionManagerFactory"


Now the problem is that {{manager.getResourceName()}} resolves to the value of the service
property {{}}, but  {{txManager.getNamedXAResourceFactory(xaResourceName)}} will
return null since {{ConnectionManagerFactory}} registered the {{GenericConnectionManager}}
under its fully qualified class name ({{org.apache.aries.transaction.jdbc.internal.ConnectionManagerFactory}}).

Result in my case is an endless loop of RollbackTasks since the NamedXAResourceFactory will
never be found.

Relevant stack trace of registration:

		Daemon Thread [FelixStartLevel] (Suspended (breakpoint at line 36 in XAResourceInsertionInterceptor))

			owns: AtomicBoolean  (id=205)	
			XAResourceInsertionInterceptor.<init>(ConnectionInterceptor, String) line: 36	
			XATransactions.addXAResourceInsertionInterceptor(ConnectionInterceptor, String) line: 61

			GenericConnectionManager$InterceptorsImpl.<init>(TransactionSupport, PoolingSupport,
SubjectSource, String, ConnectionTracker, TransactionManager, ManagedConnectionFactory, ClassLoader)
line: 129	
			GenericConnectionManager.<init>(TransactionSupport, PoolingSupport, SubjectSource,
ConnectionTracker, RecoverableTransactionManager, ManagedConnectionFactory, String, ClassLoader)
line: 67	
			org.apache.aries.transaction.jdbc.internal.ConnectionManagerFactory.init() line: 140	
			org.apache.aries.transaction.jdbc.internal.ManagedDataSourceFactory.register() line: 116

			Activator.addingService(ServiceReference) line: 95	

This message was sent by Atlassian JIRA

View raw message