14 Replies Latest reply on Jan 24, 2007 12:42 PM by Adrian Pillinger

    EJB3 - XA datasource - Transactions - XAER_OUTSIDE

    Adrian Pillinger Newbie

      I have just re-configured my EJB3 application datasources from local-tx-datasources to xa-datasources.

      Now when I run my application and the client app calls a Stateless Session Bean I get the following error in the JBoss server log:
      The database connection appears to be running outside the XA transaction of the main call.

      2007-01-23 13:32:37,551 DEBUG [org.jboss.remoting.transport.socket.ServerThread] beginning dorun
      2007-01-23 13:32:37,610 DEBUG [org.hibernate.impl.SessionImpl] opened session at timestamp: 4790514309455872
      2007-01-23 13:32:37,610 DEBUG [org.hibernate.jdbc.JDBCContext] TransactionFactory reported no active transaction; Synchronization not registered
      2007-01-23 13:32:37,610 DEBUG [org.hibernate.ejb.AbstractEntityManagerImpl] Looking for a JTA transaction to join
      2007-01-23 13:32:37,626 DEBUG [org.hibernate.jdbc.JDBCContext] successfully registered Synchronization
      2007-01-23 13:32:37,627 DEBUG [org.hibernate.ejb.AbstractEntityManagerImpl] Looking for a JTA transaction to join
      2007-01-23 13:32:37,627 DEBUG [org.hibernate.ejb.AbstractEntityManagerImpl] Transaction already joined
      2007-01-23 13:32:37,633 DEBUG [org.hibernate.jdbc.AbstractBatcher] about to open PreparedStatement (open PreparedStatements: 0, globally: 0)
      2007-01-23 13:32:37,633 DEBUG [org.hibernate.jdbc.ConnectionManager] opening JDBC connection
      2007-01-23 13:32:37,633 TRACE [org.jboss.resource.connectionmanager.TxConnectionManager] subject: null
      2007-01-23 13:32:37,633 TRACE [org.jboss.resource.connectionmanager.TxConnectionManager] getManagedConnection trackByTx=false tx=null
      2007-01-23 13:32:37,633 TRACE [org.jboss.resource.connectionmanager.TxConnectionManager] Pre-enlist: org.jboss.resource.connectionmanager.TxConnectionManager$TxConnectionEventListener@66336633[state=NORMAL mc=org.jboss.resource.adapter.jdbc.xa.XAManagedConnection@65e065e0 handles=0 lastUse=1169558982432 permit=true trackByTx=false mcp=org.jboss.resource.connectionmanager.JBossManagedConnectionPool$OnePool@a080a08 context=org.jboss.resource.connectionmanager.InternalManagedConnectionPool@5db05db0 xaResource=org.jboss.resource.adapter.jdbc.xa.XAManagedConnection@65e065e0 txSync=null] threadTx=TransactionImpl:XidImpl[FormatId=257, GlobalId=wb370/14, BranchQual=, localId=14]
      2007-01-23 13:32:37,633 TRACE [org.jboss.resource.connectionmanager.TxConnectionManager] Get synchronizer org.jboss.resource.connectionmanager.TxConnectionManager$TxConnectionEventListener@66336633[state=NORMAL mc=org.jboss.resource.adapter.jdbc.xa.XAManagedConnection@65e065e0 handles=0 lastUse=1169558982432 permit=true trackByTx=false mcp=org.jboss.resource.connectionmanager.JBossManagedConnectionPool$OnePool@a080a08 context=org.jboss.resource.connectionmanager.InternalManagedConnectionPool@5db05db0 xaResource=org.jboss.resource.adapter.jdbc.xa.XAManagedConnection@65e065e0 txSync=null] threadTx=TransactionImpl:XidImpl[FormatId=257, GlobalId=wb370/14, BranchQual=, localId=14]
      2007-01-23 13:32:37,633 TRACE [org.jboss.resource.connectionmanager.TxConnectionManager] Enlisting resource org.jboss.resource.connectionmanager.TxConnectionManager$TxConnectionEventListener@66336633[state=NORMAL mc=org.jboss.resource.adapter.jdbc.xa.XAManagedConnection@65e065e0 handles=0 lastUse=1169558982432 permit=true trackByTx=false mcp=org.jboss.resource.connectionmanager.JBossManagedConnectionPool$OnePool@a080a08 context=org.jboss.resource.connectionmanager.InternalManagedConnectionPool@5db05db0 xaResource=org.jboss.resource.adapter.jdbc.xa.XAManagedConnection@65e065e0 txSync=TxSync335746051{tx=TransactionImpl:XidImpl[FormatId=257, GlobalId=wb370/14, BranchQual=, localId=14] wasTrackByTx=false enlisted=false}]
      2007-01-23 13:32:37,633 WARN [org.jboss.tm.TransactionImpl] XAException: tx=TransactionImpl:XidImpl[FormatId=257, GlobalId=wb370/14, BranchQual=, localId=14] errorCode=XAER_OUTSIDE
      com.ibm.db2.jcc.c.zh: XAER_OUTSIDE
       at com.ibm.db2.jcc.b.bc.a(bc.java:1651)
       at com.ibm.db2.jcc.b.bc.start(bc.java:1530)
       at org.jboss.resource.adapter.jdbc.xa.XAManagedConnection.start(XAManagedConnection.java:117)
       at org.jboss.tm.TransactionImpl$Resource.startResource(TransactionImpl.java:2063)
       at org.jboss.tm.TransactionImpl.enlistResource(TransactionImpl.java:581)
       at org.jboss.resource.connectionmanager.TxConnectionManager$TxConnectionEventListener$TransactionSynchronization.enlist(TxConnectionManager.java:757)
       at org.jboss.resource.connectionmanager.TxConnectionManager$TxConnectionEventListener.enlist(TxConnectionManager.java:548)
       at org.jboss.resource.connectionmanager.TxConnectionManager.managedConnectionReconnected(TxConnectionManager.java:323)
       at org.jboss.resource.connectionmanager.BaseConnectionManager2.reconnectManagedConnection(BaseConnectionManager2.java:501)
       at org.jboss.resource.connectionmanager.BaseConnectionManager2.allocateConnection(BaseConnectionManager2.java:382)
       at org.jboss.resource.connectionmanager.BaseConnectionManager2$ConnectionManagerProxy.allocateConnection(BaseConnectionManager2.java:812)
       at org.jboss.resource.adapter.jdbc.WrapperDataSource.getConnection(WrapperDataSource.java:88)
       at org.hibernate.connection.DatasourceConnectionProvider.getConnection(DatasourceConnectionProvider.java:69)
       at org.hibernate.jdbc.ConnectionManager.openConnection(ConnectionManager.java:417)
       at org.hibernate.jdbc.ConnectionManager.getConnection(ConnectionManager.java:144)
       at org.hibernate.jdbc.AbstractBatcher.prepareQueryStatement(AbstractBatcher.java:139)
       at org.hibernate.loader.Loader.prepareQueryStatement(Loader.java:1561)
       at org.hibernate.loader.Loader.doQuery(Loader.java:661)
       at org.hibernate.loader.Loader.doQueryAndInitializeNonLazyCollections(Loader.java:224)
       at org.hibernate.loader.Loader.doList(Loader.java:2145)
       at org.hibernate.loader.Loader.listIgnoreQueryCache(Loader.java:2029)
       at org.hibernate.loader.Loader.list(Loader.java:2024)
       at org.hibernate.loader.hql.QueryLoader.list(QueryLoader.java:392)
       at org.hibernate.hql.ast.QueryTranslatorImpl.list(QueryTranslatorImpl.java:333)
       at org.hibernate.engine.query.HQLQueryPlan.performList(HQLQueryPlan.java:172)
       at org.hibernate.impl.SessionImpl.list(SessionImpl.java:1114)
       at org.hibernate.impl.QueryImpl.list(QueryImpl.java:79)
       at com.dolby.pics.model.dao.hibernate.UTInventoryNavigatorDAOHibernate.getBusinessUnitSubSystemWithInventory(UTInventoryNavigatorDAOHibernate.java:38)
       at com.dolby.pics.ut.ejb.bean.impl.UTInventoryNavigatorBean.getBusinessUnitSubSystemWithInventory(UTInventoryNavigatorBean.java:42)
       at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
       at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:64)
       at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
       at java.lang.reflect.Method.invoke(Method.java:615)
       at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:112)
       at org.jboss.ejb3.interceptor.InvocationContextImpl.proceed(InvocationContextImpl.java:166)
       at org.jboss.ejb3.interceptor.EJB3InterceptorsInterceptor.invoke(EJB3InterceptorsInterceptor.java:63)
       at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
       at org.jboss.ejb3.entity.TransactionScopedEntityManagerInterceptor.invoke(TransactionScopedEntityManagerInterceptor.java:54)
       at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
       at org.jboss.ejb3.AllowedOperationsInterceptor.invoke(AllowedOperationsInterceptor.java:47)
       at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
       at org.jboss.aspects.tx.TxPolicy.invokeInOurTx(TxPolicy.java:79)
       at org.jboss.aspects.tx.TxInterceptor$Required.invoke(TxInterceptor.java:197)
       at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
       at org.jboss.aspects.tx.TxPropagationInterceptor.invoke(TxPropagationInterceptor.java:76)
       at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
       at org.jboss.ejb3.stateless.StatelessInstanceInterceptor.invoke(StatelessInstanceInterceptor.java:62)
       at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
       at org.jboss.aspects.security.AuthenticationInterceptor.invoke(AuthenticationInterceptor.java:78)
       at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
       at org.jboss.ejb3.ENCPropagationInterceptor.invoke(ENCPropagationInterceptor.java:47)
       at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
       at org.jboss.ejb3.asynchronous.AsynchronousInterceptor.invoke(AsynchronousInterceptor.java:106)
       at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
       at org.jboss.ejb3.stateless.StatelessContainer.dynamicInvoke(StatelessContainer.java:227)
       at org.jboss.aop.Dispatcher.invoke(Dispatcher.java:106)
       at org.jboss.aspects.remoting.AOPRemotingInvocationHandler.invoke(AOPRemotingInvocationHandler.java:82)
       at org.jboss.remoting.ServerInvoker.invoke(ServerInvoker.java:828)
       at org.jboss.remoting.ServerInvoker.invoke(ServerInvoker.java:681)
       at org.jboss.remoting.transport.socket.ServerThread.processInvocation(ServerThread.java:358)
       at org.jboss.remoting.transport.socket.ServerThread.dorun(ServerThread.java:398)
       at org.jboss.remoting.transport.socket.ServerThread.run(ServerThread.java:239)
      2007-01-23 13:32:37,648 TRACE [org.jboss.resource.connectionmanager.TxConnectionManager] Failed to enlist resource org.jboss.resource.connectionmanager.TxConnectionManager$TxConnectionEventListener@66336633[state=NORMAL mc=org.jboss.resource.adapter.jdbc.xa.XAManagedConnection@65e065e0 handles=0 lastUse=1169558982432 permit=true trackByTx=false mcp=org.jboss.resource.connectionmanager.JBossManagedConnectionPool$OnePool@a080a08 context=org.jboss.resource.connectionmanager.InternalManagedConnectionPool@5db05db0 xaResource=org.jboss.resource.adapter.jdbc.xa.XAManagedConnection@65e065e0 txSync=TxSync335746051{tx=TransactionImpl:XidImpl[FormatId=257, GlobalId=wb370/14, BranchQual=, localId=14] wasTrackByTx=false enlisted=false}]
      java.lang.Throwable: Unabled to enlist resource, see the previous warnings.
       at org.jboss.resource.connectionmanager.TxConnectionManager.<clinit>(TxConnectionManager.java:130)
       at java.lang.J9VMInternals.initializeImpl(Native Method)
       at java.lang.J9VMInternals.initialize(J9VMInternals.java:177)
       at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
       at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:67)
       at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
       at java.lang.reflect.Constructor.newInstance(Constructor.java:521)
       at org.jboss.mx.server.MBeanServerImpl.instantiate(MBeanServerImpl.java:1233)
       at org.jboss.mx.server.MBeanServerImpl.instantiate(MBeanServerImpl.java:286)
       at org.jboss.mx.server.MBeanServerImpl.createMBean(MBeanServerImpl.java:344)
       at org.jboss.system.ServiceCreator.install(ServiceCreator.java:157)
       at org.jboss.system.ServiceConfigurator.internalInstall(ServiceConfigurator.java:449)
       at org.jboss.system.ServiceConfigurator.install(ServiceConfigurator.java:171)
       at org.jboss.system.ServiceController.install(ServiceController.java:226)
       at sun.reflect.GeneratedMethodAccessor62.invoke(Unknown Source)
       at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
       at java.lang.reflect.Method.invoke(Method.java:615)
       at org.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatcher.java:155)
       at org.jboss.mx.server.Invocation.dispatch(Invocation.java:94)
       at org.jboss.mx.server.Invocation.invoke(Invocation.java:86)
       at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:264)
       at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:659)
       at org.jboss.mx.util.MBeanProxyExt.invoke(MBeanProxyExt.java:210)
       at $Proxy4.install(Unknown Source)
       at org.jboss.deployment.SARDeployer.create(SARDeployer.java:249)
       at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
       at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:64)
       at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
       at java.lang.reflect.Method.invoke(Method.java:615)
       at org.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatcher.java:155)
       at org.jboss.mx.server.Invocation.dispatch(Invocation.java:94)
       at org.jboss.mx.interceptor.AbstractInterceptor.invoke(AbstractInterceptor.java:133)
       at org.jboss.mx.server.Invocation.invoke(Invocation.java:88)
       at org.jboss.mx.interceptor.ModelMBeanOperationInterceptor.invoke(ModelMBeanOperationInterceptor.java:142)
       at org.jboss.mx.server.Invocation.invoke(Invocation.java:88)
       at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:264)
       at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:659)
       at org.jboss.mx.util.MBeanProxyExt.invoke(MBeanProxyExt.java:210)
       at $Proxy54.create(Unknown Source)
       at org.jboss.deployment.XSLSubDeployer.create(XSLSubDeployer.java:192)
       at org.jboss.deployment.MainDeployer.create(MainDeployer.java:953)
       at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:807)
       at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:771)
       at sun.reflect.GeneratedMethodAccessor60.invoke(Unknown Source)
       at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
       at java.lang.reflect.Method.invoke(Method.java:615)
       at org.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatcher.java:155)
       at org.jboss.mx.server.Invocation.dispatch(Invocation.java:94)
       at org.jboss.mx.interceptor.AbstractInterceptor.invoke(AbstractInterceptor.java:133)
       at org.jboss.mx.server.Invocation.invoke(Invocation.java:88)
       at org.jboss.mx.interceptor.ModelMBeanOperationInterceptor.invoke(ModelMBeanOperationInterceptor.java:142)
       at org.jboss.mx.server.Invocation.invoke(Invocation.java:88)
       at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:264)
       at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:659)
       at org.jboss.mx.util.MBeanProxyExt.invoke(MBeanProxyExt.java:210)
       at $Proxy8.deploy(Unknown Source)
       at org.jboss.deployment.scanner.URLDeploymentScanner.deploy(URLDeploymentScanner.java:421)
       at org.jboss.deployment.scanner.URLDeploymentScanner.scan(URLDeploymentScanner.java:634)
       at org.jboss.deployment.scanner.AbstractDeploymentScanner$ScannerThread.doScan(AbstractDeploymentScanner.java:263)
       at org.jboss.deployment.scanner.AbstractDeploymentScanner.startService(AbstractDeploymentScanner.java:336)
       at org.jboss.system.ServiceMBeanSupport.jbossInternalStart(ServiceMBeanSupport.java:289)
       at org.jboss.system.ServiceMBeanSupport.jbossInternalLifecycle(ServiceMBeanSupport.java:245)
       at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
       at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:64)
       at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
       at java.lang.reflect.Method.invoke(Method.java:615)
       at org.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatcher.java:155)
       at org.jboss.mx.server.Invocation.dispatch(Invocation.java:94)
       at org.jboss.mx.server.Invocation.invoke(Invocation.java:86)
       at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:264)
       at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:659)
       at org.jboss.system.ServiceController$ServiceProxy.invoke(ServiceController.java:978)
       at $Proxy0.start(Unknown Source)
       at org.jboss.system.ServiceController.start(ServiceController.java:417)
       at sun.reflect.GeneratedMethodAccessor5.invoke(Unknown Source)
       at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
       at java.lang.reflect.Method.invoke(Method.java:615)
       at org.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatcher.java:155)
       at org.jboss.mx.server.Invocation.dispatch(Invocation.java:94)
       at org.jboss.mx.server.Invocation.invoke(Invocation.java:86)
       at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:264)
       at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:659)
       at org.jboss.mx.util.MBeanProxyExt.invoke(MBeanProxyExt.java:210)
       at $Proxy4.start(Unknown Source)
       at org.jboss.deployment.SARDeployer.start(SARDeployer.java:302)
       at org.jboss.deployment.MainDeployer.start(MainDeployer.java:1007)
       at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:808)
       at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:771)
       at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:755)
       at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
       at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:64)
       at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
       at java.lang.reflect.Method.invoke(Method.java:615)
       at org.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatcher.java:155)
       at org.jboss.mx.server.Invocation.dispatch(Invocation.java:94)
       at org.jboss.mx.interceptor.AbstractInterceptor.invoke(AbstractInterceptor.java:133)
       at org.jboss.mx.server.Invocation.invoke(Invocation.java:88)
       at org.jboss.mx.interceptor.ModelMBeanOperationInterceptor.invoke(ModelMBeanOperationInterceptor.java:142)
       at org.jboss.mx.server.Invocation.invoke(Invocation.java:88)
       at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:264)
       at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:659)
       at org.jboss.mx.util.MBeanProxyExt.invoke(MBeanProxyExt.java:210)
       at $Proxy5.deploy(Unknown Source)
       at org.jboss.system.server.ServerImpl.doStart(ServerImpl.java:482)
       at org.jboss.system.server.ServerImpl.start(ServerImpl.java:362)
       at org.jboss.Main.boot(Main.java:200)
       at org.jboss.Main$1.run(Main.java:464)
       at java.lang.Thread.run(Thread.java:797)
      2007-01-23 13:32:37,776 TRACE [org.jboss.resource.connectionmanager.TxConnectionManager] Check enlisted org.jboss.resource.connectionmanager.TxConnectionManager$TxConnectionEventListener@66336633[state=NORMAL mc=org.jboss.resource.adapter.jdbc.xa.XAManagedConnection@65e065e0 handles=0 lastUse=1169558982432 permit=true trackByTx=false mcp=org.jboss.resource.connectionmanager.JBossManagedConnectionPool$OnePool@a080a08 context=org.jboss.resource.connectionmanager.InternalManagedConnectionPool@5db05db0 xaResource=org.jboss.resource.adapter.jdbc.xa.XAManagedConnection@65e065e0 txSync=null] threadTx=TransactionImpl:XidImpl[FormatId=257, GlobalId=wb370/14, BranchQual=, localId=14]
      2007-01-23 13:32:37,776 TRACE [org.jboss.resource.connectionmanager.TxConnectionManager] Error enlisting resource in transaction=TransactionImpl:XidImpl[FormatId=257, GlobalId=wb370/14, BranchQual=, localId=14] org.jboss.resource.connectionmanager.TxConnectionManager$TxConnectionEventListener@66336633[state=NORMAL mc=org.jboss.resource.adapter.jdbc.xa.XAManagedConnection@65e065e0 handles=0 lastUse=1169558982432 permit=true trackByTx=false mcp=org.jboss.resource.connectionmanager.JBossManagedConnectionPool$OnePool@a080a08 context=org.jboss.resource.connectionmanager.InternalManagedConnectionPool@5db05db0 xaResource=org.jboss.resource.adapter.jdbc.xa.XAManagedConnection@65e065e0 txSync=null]
      2007-01-23 13:32:37,776 TRACE [org.jboss.resource.connectionmanager.TxConnectionManager] Could not enlist in transaction on entering meta-aware object! org.jboss.resource.connectionmanager.TxConnectionManager$TxConnectionEventListener@66336633[state=NORMAL mc=org.jboss.resource.adapter.jdbc.xa.XAManagedConnection@65e065e0 handles=0 lastUse=1169558982432 permit=true trackByTx=false mcp=org.jboss.resource.connectionmanager.JBossManagedConnectionPool$OnePool@a080a08 context=org.jboss.resource.connectionmanager.InternalManagedConnectionPool@5db05db0 xaResource=org.jboss.resource.adapter.jdbc.xa.XAManagedConnection@65e065e0 txSync=null]
      javax.transaction.SystemException: java.lang.Throwable: Unabled to enlist resource, see the previous warnings. tx=TransactionImpl:XidImpl[FormatId=257, GlobalId=wb370/14, BranchQual=, localId=14]
       at org.jboss.resource.connectionmanager.TxConnectionManager$TxConnectionEventListener$TransactionSynchronization.checkEnlisted(TxConnectionManager.java:728)
       at org.jboss.resource.connectionmanager.TxConnectionManager$TxConnectionEventListener.enlist(TxConnectionManager.java:561)
       at org.jboss.resource.connectionmanager.TxConnectionManager.managedConnectionReconnected(TxConnectionManager.java:323)
       at org.jboss.resource.connectionmanager.BaseConnectionManager2.reconnectManagedConnection(BaseConnectionManager2.java:501)
       at org.jboss.resource.connectionmanager.BaseConnectionManager2.allocateConnection(BaseConnectionManager2.java:382)
       at org.jboss.resource.connectionmanager.BaseConnectionManager2$ConnectionManagerProxy.allocateConnection(BaseConnectionManager2.java:812)
       at org.jboss.resource.adapter.jdbc.WrapperDataSource.getConnection(WrapperDataSource.java:88)
       at org.hibernate.connection.DatasourceConnectionProvider.getConnection(DatasourceConnectionProvider.java:69)
       at org.hibernate.jdbc.ConnectionManager.openConnection(ConnectionManager.java:417)
       at org.hibernate.jdbc.ConnectionManager.getConnection(ConnectionManager.java:144)
       at org.hibernate.jdbc.AbstractBatcher.prepareQueryStatement(AbstractBatcher.java:139)
       at org.hibernate.loader.Loader.prepareQueryStatement(Loader.java:1561)
       at org.hibernate.loader.Loader.doQuery(Loader.java:661)
       at org.hibernate.loader.Loader.doQueryAndInitializeNonLazyCollections(Loader.java:224)
       at org.hibernate.loader.Loader.doList(Loader.java:2145)
       at org.hibernate.loader.Loader.listIgnoreQueryCache(Loader.java:2029)
       at org.hibernate.loader.Loader.list(Loader.java:2024)
       at org.hibernate.loader.hql.QueryLoader.list(QueryLoader.java:392)
       at org.hibernate.hql.ast.QueryTranslatorImpl.list(QueryTranslatorImpl.java:333)
       at org.hibernate.engine.query.HQLQueryPlan.performList(HQLQueryPlan.java:172)
       at org.hibernate.impl.SessionImpl.list(SessionImpl.java:1114)
       at org.hibernate.impl.QueryImpl.list(QueryImpl.java:79)
       at com.dolby.pics.model.dao.hibernate.UTInventoryNavigatorDAOHibernate.getBusinessUnitSubSystemWithInventory(UTInventoryNavigatorDAOHibernate.java:38)
       at com.dolby.pics.ut.ejb.bean.impl.UTInventoryNavigatorBean.getBusinessUnitSubSystemWithInventory(UTInventoryNavigatorBean.java:42)
       at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
       at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:64)
       at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
       at java.lang.reflect.Method.invoke(Method.java:615)
       at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:112)
       at org.jboss.ejb3.interceptor.InvocationContextImpl.proceed(InvocationContextImpl.java:166)
       at org.jboss.ejb3.interceptor.EJB3InterceptorsInterceptor.invoke(EJB3InterceptorsInterceptor.java:63)
       at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
       at org.jboss.ejb3.entity.TransactionScopedEntityManagerInterceptor.invoke(TransactionScopedEntityManagerInterceptor.java:54)
       at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
       at org.jboss.ejb3.AllowedOperationsInterceptor.invoke(AllowedOperationsInterceptor.java:47)
       at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
       at org.jboss.aspects.tx.TxPolicy.invokeInOurTx(TxPolicy.java:79)
       at org.jboss.aspects.tx.TxInterceptor$Required.invoke(TxInterceptor.java:197)
       at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
       at org.jboss.aspects.tx.TxPropagationInterceptor.invoke(TxPropagationInterceptor.java:76)
       at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
       at org.jboss.ejb3.stateless.StatelessInstanceInterceptor.invoke(StatelessInstanceInterceptor.java:62)
       at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
       at org.jboss.aspects.security.AuthenticationInterceptor.invoke(AuthenticationInterceptor.java:78)
       at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
       at org.jboss.ejb3.ENCPropagationInterceptor.invoke(ENCPropagationInterceptor.java:47)
       at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
       at org.jboss.ejb3.asynchronous.AsynchronousInterceptor.invoke(AsynchronousInterceptor.java:106)
       at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
       at org.jboss.ejb3.stateless.StatelessContainer.dynamicInvoke(StatelessContainer.java:227)
       at org.jboss.aop.Dispatcher.invoke(Dispatcher.java:106)
       at org.jboss.aspects.remoting.AOPRemotingInvocationHandler.invoke(AOPRemotingInvocationHandler.java:82)
       at org.jboss.remoting.ServerInvoker.invoke(ServerInvoker.java:828)
       at org.jboss.remoting.ServerInvoker.invoke(ServerInvoker.java:681)
       at org.jboss.remoting.transport.socket.ServerThread.processInvocation(ServerThread.java:358)
       at org.jboss.remoting.transport.socket.ServerThread.dorun(ServerThread.java:398)
       at org.jboss.remoting.transport.socket.ServerThread.run(ServerThread.java:239)
      2007-01-23 13:32:37,791 TRACE [org.jboss.resource.connectionmanager.TxConnectionManager] delisting org.jboss.resource.connectionmanager.TxConnectionManager$TxConnectionEventListener@66336633[state=NORMAL mc=org.jboss.resource.adapter.jdbc.xa.XAManagedConnection@65e065e0 handles=0 lastUse=1169558982432 permit=true trackByTx=false mcp=org.jboss.resource.connectionmanager.JBossManagedConnectionPool$OnePool@a080a08 context=org.jboss.resource.connectionmanager.InternalManagedConnectionPool@5db05db0 xaResource=org.jboss.resource.adapter.jdbc.xa.XAManagedConnection@65e065e0 txSync=null]
      2007-01-23 13:32:37,791 TRACE [org.jboss.resource.connectionmanager.TxConnectionManager] Disconnected isManagedConnectionFree=true cl=org.jboss.resource.connectionmanager.TxConnectionManager$TxConnectionEventListener@66336633[state=NORMAL mc=org.jboss.resource.adapter.jdbc.xa.XAManagedConnection@65e065e0 handles=0 lastUse=1169558982432 permit=true trackByTx=false mcp=org.jboss.resource.connectionmanager.JBossManagedConnectionPool$OnePool@a080a08 context=org.jboss.resource.connectionmanager.InternalManagedConnectionPool@5db05db0 xaResource=org.jboss.resource.adapter.jdbc.xa.XAManagedConnection@65e065e0 txSync=null]
      2007-01-23 13:32:37,792 DEBUG [org.hibernate.util.JDBCExceptionReporter] Cannot open connection [???]
      org.jboss.util.NestedSQLException: Could not enlist in transaction on entering meta-aware object!; - nested throwable: (javax.transaction.SystemException: java.lang.Throwable: Unabled to enlist resource, see the previous warnings. tx=TransactionImpl:XidImpl[FormatId=257, GlobalId=wb370/14, BranchQual=, localId=14]); - nested throwable: (org.jboss.resource.JBossResourceException: Could not enlist in transaction on entering meta-aware object!; - nested throwable: (javax.transaction.SystemException: java.lang.Throwable: Unabled to enlist resource, see the previous warnings. tx=TransactionImpl:XidImpl[FormatId=257, GlobalId=wb370/14, BranchQual=, localId=14]))
       at org.jboss.resource.adapter.jdbc.WrapperDataSource.getConnection(WrapperDataSource.java:94)
       at org.hibernate.connection.DatasourceConnectionProvider.getConnection(DatasourceConnectionProvider.java:69)
       at org.hibernate.jdbc.ConnectionManager.openConnection(ConnectionManager.java:417)
       at org.hibernate.jdbc.ConnectionManager.getConnection(ConnectionManager.java:144)
       at org.hibernate.jdbc.AbstractBatcher.prepareQueryStatement(AbstractBatcher.java:139)
       at org.hibernate.loader.Loader.prepareQueryStatement(Loader.java:1561)
       at org.hibernate.loader.Loader.doQuery(Loader.java:661)
       at org.hibernate.loader.Loader.doQueryAndInitializeNonLazyCollections(Loader.java:224)
       at org.hibernate.loader.Loader.doList(Loader.java:2145)
       at org.hibernate.loader.Loader.listIgnoreQueryCache(Loader.java:2029)
       at org.hibernate.loader.Loader.list(Loader.java:2024)
       at org.hibernate.loader.hql.QueryLoader.list(QueryLoader.java:392)
       at org.hibernate.hql.ast.QueryTranslatorImpl.list(QueryTranslatorImpl.java:333)
       at org.hibernate.engine.query.HQLQueryPlan.performList(HQLQueryPlan.java:172)
       at org.hibernate.impl.SessionImpl.list(SessionImpl.java:1114)
       at org.hibernate.impl.QueryImpl.list(QueryImpl.java:79)
       at com.dolby.pics.model.dao.hibernate.UTInventoryNavigatorDAOHibernate.getBusinessUnitSubSystemWithInventory(UTInventoryNavigatorDAOHibernate.java:38)
       at com.dolby.pics.ut.ejb.bean.impl.UTInventoryNavigatorBean.getBusinessUnitSubSystemWithInventory(UTInventoryNavigatorBean.java:42)
       at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
       at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:64)
       at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
       at java.lang.reflect.Method.invoke(Method.java:615)
       at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:112)
       at org.jboss.ejb3.interceptor.InvocationContextImpl.proceed(InvocationContextImpl.java:166)
       at org.jboss.ejb3.interceptor.EJB3InterceptorsInterceptor.invoke(EJB3InterceptorsInterceptor.java:63)
       at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
       at org.jboss.ejb3.entity.TransactionScopedEntityManagerInterceptor.invoke(TransactionScopedEntityManagerInterceptor.java:54)
       at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
       at org.jboss.ejb3.AllowedOperationsInterceptor.invoke(AllowedOperationsInterceptor.java:47)
       at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
       at org.jboss.aspects.tx.TxPolicy.invokeInOurTx(TxPolicy.java:79)
       at org.jboss.aspects.tx.TxInterceptor$Required.invoke(TxInterceptor.java:197)
       at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
       at org.jboss.aspects.tx.TxPropagationInterceptor.invoke(TxPropagationInterceptor.java:76)
       at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
       at org.jboss.ejb3.stateless.StatelessInstanceInterceptor.invoke(StatelessInstanceInterceptor.java:62)
       at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
       at org.jboss.aspects.security.AuthenticationInterceptor.invoke(AuthenticationInterceptor.java:78)
       at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
       at org.jboss.ejb3.ENCPropagationInterceptor.invoke(ENCPropagationInterceptor.java:47)
       at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
       at org.jboss.ejb3.asynchronous.AsynchronousInterceptor.invoke(AsynchronousInterceptor.java:106)
       at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
       at org.jboss.ejb3.stateless.StatelessContainer.dynamicInvoke(StatelessContainer.java:227)
       at org.jboss.aop.Dispatcher.invoke(Dispatcher.java:106)
       at org.jboss.aspects.remoting.AOPRemotingInvocationHandler.invoke(AOPRemotingInvocationHandler.java:82)
       at org.jboss.remoting.ServerInvoker.invoke(ServerInvoker.java:828)
       at org.jboss.remoting.ServerInvoker.invoke(ServerInvoker.java:681)
       at org.jboss.remoting.transport.socket.ServerThread.processInvocation(ServerThread.java:358)
       at org.jboss.remoting.transport.socket.ServerThread.dorun(ServerThread.java:398)
       at org.jboss.remoting.transport.socket.ServerThread.run(ServerThread.java:239)
      Caused by:
      org.jboss.resource.JBossResourceException: Could not enlist in transaction on entering meta-aware object!; - nested throwable: (javax.transaction.SystemException: java.lang.Throwable: Unabled to enlist resource, see the previous warnings. tx=TransactionImpl:XidImpl[FormatId=257, GlobalId=wb370/14, BranchQual=, localId=14])
       at org.jboss.resource.connectionmanager.TxConnectionManager.managedConnectionReconnected(TxConnectionManager.java:329)
       at org.jboss.resource.connectionmanager.BaseConnectionManager2.reconnectManagedConnection(BaseConnectionManager2.java:501)
       at org.jboss.resource.connectionmanager.BaseConnectionManager2.allocateConnection(BaseConnectionManager2.java:382)
       at org.jboss.resource.connectionmanager.BaseConnectionManager2$ConnectionManagerProxy.allocateConnection(BaseConnectionManager2.java:812)
       at org.jboss.resource.adapter.jdbc.WrapperDataSource.getConnection(WrapperDataSource.java:88)
       ... 50 more
      Caused by:
      javax.transaction.SystemException: java.lang.Throwable: Unabled to enlist resource, see the previous warnings. tx=TransactionImpl:XidImpl[FormatId=257, GlobalId=wb370/14, BranchQual=, localId=14]
       at org.jboss.resource.connectionmanager.TxConnectionManager$TxConnectionEventListener$TransactionSynchronization.checkEnlisted(TxConnectionManager.java:728)
       at org.jboss.resource.connectionmanager.TxConnectionManager$TxConnectionEventListener.enlist(TxConnectionManager.java:561)
       at org.jboss.resource.connectionmanager.TxConnectionManager.managedConnectionReconnected(TxConnectionManager.java:323)
       ... 54 more
      2007-01-23 13:32:37,818 WARN [org.hibernate.util.JDBCExceptionReporter] SQL Error: 0, SQLState: null
      2007-01-23 13:32:37,818 ERROR [org.hibernate.util.JDBCExceptionReporter] Could not enlist in transaction on entering meta-aware object!; - nested throwable: (javax.transaction.SystemException: java.lang.Throwable: Unabled to enlist resource, see the previous warnings. tx=TransactionImpl:XidImpl[FormatId=257, GlobalId=wb370/14, BranchQual=, localId=14]); - nested throwable: (org.jboss.resource.JBossResourceException: Could not enlist in transaction on entering meta-aware object!; - nested throwable: (javax.transaction.SystemException: java.lang.Throwable: Unabled to enlist resource, see the previous warnings. tx=TransactionImpl:XidImpl[FormatId=257, GlobalId=wb370/14, BranchQual=, localId=14]))
      2007-01-23 13:32:37,819 WARN [org.jboss.tm.TransactionImpl] XAException: tx=TransactionImpl:XidImpl[FormatId=257, GlobalId=wb370/14, BranchQual=, localId=14] errorCode=XAER_NOTA
      com.ibm.db2.jcc.c.zh: XAER_NOTA
       at com.ibm.db2.jcc.b.bc.a(bc.java:1651)
       at com.ibm.db2.jcc.b.bc.b(bc.java:1060)
       at com.ibm.db2.jcc.b.bc.rollback(bc.java:1010)
       at org.jboss.resource.adapter.jdbc.xa.XAManagedConnection.rollback(XAManagedConnection.java:152)
       at org.jboss.tm.TransactionImpl$Resource.rollback(TransactionImpl.java:2277)
       at org.jboss.tm.TransactionImpl.rollbackResources(TransactionImpl.java:1837)
       at org.jboss.tm.TransactionImpl.rollback(TransactionImpl.java:412)
       at org.jboss.tm.TxManager.rollback(TxManager.java:364)
       at org.jboss.aspects.tx.TxPolicy.endTransaction(TxPolicy.java:167)
       at org.jboss.aspects.tx.TxPolicy.invokeInOurTx(TxPolicy.java:87)
       at org.jboss.aspects.tx.TxInterceptor$Required.invoke(TxInterceptor.java:197)
       at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
       at org.jboss.aspects.tx.TxPropagationInterceptor.invoke(TxPropagationInterceptor.java:76)
       at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
       at org.jboss.ejb3.stateless.StatelessInstanceInterceptor.invoke(StatelessInstanceInterceptor.java:62)
       at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
       at org.jboss.aspects.security.AuthenticationInterceptor.invoke(AuthenticationInterceptor.java:78)
       at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
       at org.jboss.ejb3.ENCPropagationInterceptor.invoke(ENCPropagationInterceptor.java:47)
       at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
       at org.jboss.ejb3.asynchronous.AsynchronousInterceptor.invoke(AsynchronousInterceptor.java:106)
       at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
       at org.jboss.ejb3.stateless.StatelessContainer.dynamicInvoke(StatelessContainer.java:227)
       at org.jboss.aop.Dispatcher.invoke(Dispatcher.java:106)
       at org.jboss.aspects.remoting.AOPRemotingInvocationHandler.invoke(AOPRemotingInvocationHandler.java:82)
       at org.jboss.remoting.ServerInvoker.invoke(ServerInvoker.java:828)
       at org.jboss.remoting.ServerInvoker.invoke(ServerInvoker.java:681)
       at org.jboss.remoting.transport.socket.ServerThread.processInvocation(ServerThread.java:358)
       at org.jboss.remoting.transport.socket.ServerThread.dorun(ServerThread.java:398)
       at org.jboss.remoting.transport.socket.ServerThread.run(ServerThread.java:239)
      2007-01-23 13:32:37,829 DEBUG [org.hibernate.jdbc.JDBCContext] TransactionFactory reported no active transaction; Synchronization not registered
      2007-01-23 13:32:37,829 DEBUG [org.hibernate.jdbc.JDBCContext] TransactionFactory reported no active transaction; Synchronization not registered
      2007-01-23 13:32:37,830 DEBUG [org.hibernate.jdbc.JDBCContext] TransactionFactory reported no active transaction; Synchronization not registered
      2007-01-23 13:32:37,830 DEBUG [org.jboss.ejb3.entity.ManagedEntityManagerFactory] ************** closing entity managersession **************
      2007-01-23 13:32:37,830 DEBUG [org.hibernate.jdbc.JDBCContext] TransactionFactory reported no active transaction; Synchronization not registered
      2007-01-23 13:33:37,937 DEBUG [org.jboss.remoting.transport.socket.ServerThread] begin thread wait
      


      My data source is conigured as follows:

      <?xml version="1.0" encoding="UTF-8"?>
      <datasources>
       <xa-datasource>
       <jndi-name>PicsDS</jndi-name>
       <xa-datasource-class>com.ibm.db2.jcc.DB2XADataSource</xa-datasource-class>
       <xa-datasource-property name="DatabaseName">zcoreinv</xa-datasource-property>
       <xa-datasource-property name="User">zcoreinv</xa-datasource-property>
       <xa-datasource-property name="Password">zcoreinv</xa-datasource-property>
       <xa-datasource-property name="PortNumber">50000</xa-datasource-property>
       <xa-datasource-property name="ServerName">localhost</xa-datasource-property>
       <xa-datasource-property name="DriverType">4</xa-datasource-property>
       <!-- corresponding type-mapping in the standardjbosscmp-jdbc.xml (optional) -->
       <metadata>
       <type-mapping>DB2</type-mapping>
       </metadata>
       </xa-datasource>
      </datasources>
      


      The relevant EJB code...

      1. The SLSB the client is calling
      @Stateless
      @TransactionManagement(value=TransactionManagementType.CONTAINER)
      public class UTInventoryNavigatorBean extends AbstractSession implements IUTInventoryNavigatorLocal, IUTInventoryNavigatorRemote
      {
       @EJB
       IUTDAOFactoryBean factory;
      
       /**
       * @see com.dolby.pics.ut.ejb.bean.IUTInventoryNavigator#getBusinessUnitSubSystemWithInventory()
       */
       @TransactionAttribute(value = TransactionAttributeType.REQUIRED)
       public List<?> getBusinessUnitSubSystemWithInventory()
       {
       return getDao().getBusinessUnitSubSystemWithInventory();
       }
      
      
       private IUTInventoryNavigatorDAO getDao()
       {
       return factory.getUTInventoryNavigatorDAO();
       }
      }
      


      2. The SLSB that UTInventoryNavigatorBean has injected at runtime into its factory field.
      @Stateless
      @TransactionManagement(value=TransactionManagementType.CONTAINER)
      public class UTDAOFactoryBean implements IUTDAOFactoryBean
      {
      
       @PersistenceContext(unitName=PICS.PERSISTENCE_CONTEXT_UNIT_NAME)
       Session session;
       /**
       *
       */
       public UTDAOFactoryBean()
       {
       super();
       }
      
       /**
       * @see com.dolby.pics.model.dao.IUTDAOFactory#getUTInventoryNavigatorDAO()
       */
       public IUTInventoryNavigatorDAO getUTInventoryNavigatorDAO() {
       return new UTInventoryNavigatorDAOHibernate(session);
       }
      }
      


      3. The DAO implementation
      public class UTInventoryNavigatorDAOHibernate
       extends GenericHibernateDAO
       implements IUTInventoryNavigatorDAO {
      
       /**
       * @param session
       */
       public UTInventoryNavigatorDAOHibernate(final org.hibernate.Session session)
       {
       super(session);
       }
      
       /**
       * @see com.dolby.pics.model.dao.IUTInventoryNavigatorDAO#getBusinessUnitSubSystemWithInventory()
       */
       @SuppressWarnings("unchecked")
       public List<?> getBusinessUnitSubSystemWithInventory()
       {
       final Query query = getCurrentSession().getNamedQuery(QueryBusinessUnitsWithInventory.NAME);
       final List<?> l = query.list();
       return l;
       }
      }
      


      4. The DAOs superclass
      public class GenericHibernateDAO implements IGenericDAO
      {
       private Session session;
      
       public GenericHibernateDAO(Session session)
       {
       setCurrentSession(session);
       }
      
       /**
       * Rerturns the current session in use by this DAO.
       *
       * @return the current hibernate session
       */
       protected Session getCurrentSession()
       {
       return this.session;
       }
      


      I think it is probably either a problem with the config of my XA datasources or more my transaction demarcation on the EJBs. Or the use of the injected session into the EJB.

      Any help would be very much appreciated.

      NOTE:
      Tested issue with both JBoss 4.0.4GA and JBoss 5 Beta 1.
      The application worked fine on JBoss 4.0.4GA with local-tx-datasources.