At some time,we could detect the session being operated with a wrong tx context. The error is well reported but the session is not destroyed. This make the application encountering the error condition as each time the connection is returned from the pool.
Here is the corresponding stack trace on which we're working on
2015-11-17 12:10:02,929 ERROR [Nuxeo-Work-default-2] [org.nuxeo.ecm.core.storage.sql.jdbc.JDBCLogger] (19) SQL: XA start error on org.apache.geronimo.transaction.manager.XidImpl@7072348e
javax.transaction.xa.XAException: Already started
at org.nuxeo.ecm.core.storage.sql.jdbc.XAResourceConnectionAdapter.newXAException(XAResourceConnectionAdapter.java:151)
at org.nuxeo.ecm.core.storage.sql.jdbc.XAResourceConnectionAdapter.start(XAResourceConnectionAdapter.java:54)
at org.nuxeo.ecm.core.storage.sql.jdbc.JDBCMapper.start(JDBCMapper.java:1272)
at sun.reflect.GeneratedMethodAccessor1518.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:606)
at org.nuxeo.ecm.core.storage.sql.jdbc.JDBCMapperConnector.doInvoke(JDBCMapperConnector.java:22)
at org.nuxeo.ecm.core.storage.sql.jdbc.JDBCMapperConnector.invoke(JDBCMapperConnector.java:31)
at com.sun.proxy.$Proxy52.start(Unknown Source)
at org.nuxeo.ecm.core.storage.sql.SoftRefCachingMapper.start(SoftRefCachingMapper.java:171)
at org.nuxeo.ecm.core.storage.sql.SessionImpl.start(SessionImpl.java:1465)
at org.apache.geronimo.transaction.manager.WrapperNamedXAResource.start(WrapperNamedXAResource.java:111)
at org.apache.geronimo.transaction.manager.TransactionImpl.enlistResource(TransactionImpl.java:202)
at org.apache.geronimo.connector.outbound.TransactionEnlistingInterceptor.getConnection(TransactionEnlistingInterceptor.java:60)
at org.apache.geronimo.connector.outbound.TransactionCachingInterceptor.getConnection(TransactionCachingInterceptor.java:101)
at org.apache.geronimo.connector.outbound.ConnectionHandleInterceptor.getConnection(ConnectionHandleInterceptor.java:43)
at org.apache.geronimo.connector.outbound.TCCLInterceptor.getConnection(TCCLInterceptor.java:39)
at org.apache.geronimo.connector.outbound.ConnectionTrackingInterceptor.getConnection(ConnectionTrackingInterceptor.java:66)
at org.apache.geronimo.connector.outbound.AbstractConnectionManager.allocateConnection(AbstractConnectionManager.java:77)
at org.nuxeo.runtime.jtajca.NuxeoContainer$ConnectionManagerWrapper.allocateConnection(NuxeoContainer.java:834)
at org.nuxeo.ecm.core.storage.sql.ra.ConnectionFactoryImpl.getConnection(ConnectionFactoryImpl.java:100)
at org.nuxeo.ecm.core.storage.sql.ra.ConnectionFactoryImpl.getSession(ConnectionFactoryImpl.java:166)
at org.nuxeo.ecm.core.repository.RepositoryService.getSession(RepositoryService.java:233)
at org.nuxeo.ecm.core.api.local.LocalSession.createSession(LocalSession.java:119)
at org.nuxeo.ecm.core.api.local.LocalSession.connect(LocalSession.java:85)
at org.nuxeo.ecm.core.api.CoreInstance.acquireCoreSession(CoreInstance.java:185)
at org.nuxeo.ecm.core.api.CoreInstance.openCoreSession(CoreInstance.java:179)
at org.nuxeo.ecm.core.api.CoreInstance.openCoreSessionSystem(CoreInstance.java:113)
at org.nuxeo.ecm.core.event.impl.ReconnectedEventBundleImpl.getReconnectedCoreSession(ReconnectedEventBundleImpl.java:87)
at org.nuxeo.ecm.core.event.impl.ReconnectedEventBundleImpl.getReconnectedEvents(ReconnectedEventBundleImpl.java:108)
at org.nuxeo.ecm.core.event.impl.ReconnectedEventBundleImpl.iterator(ReconnectedEventBundleImpl.java:220)
at org.nuxeo.ecm.platform.ec.notification.NotificationEventListener.handleEvent(NotificationEventListener.java:105)