8 Replies Latest reply on Sep 28, 2010 2:17 PM by mphoenix

    Transaction problem: Could not enlist in transaction

    magix
      Hi,

      I used the seam-gen tool (Seam-2.1.2GA) to generate a project and during tests everything seemed to work fine.

      But now in production after some time there seems to appear a problem with the transaction-manager:


      [11:20:19,429,application] javax.persistence.PersistenceException: org.hibernate.exception.GenericJDBCException: Cannot open connection
      javax.faces.el.EvaluationException: javax.persistence.PersistenceException: org.hibernate.exception.GenericJDBCException: Cannot open connection
           at javax.faces.component.MethodBindingMethodExpressionAdapter.invoke(MethodBindingMethodExpressionAdapter.java:102)
           at com.sun.faces.application.ActionListenerImpl.processAction(ActionListenerImpl.java:102)
           at javax.faces.component.UICommand.broadcast(UICommand.java:387)
           at org.ajax4jsf.component.AjaxViewRoot.processEvents(AjaxViewRoot.java:321)
           at org.ajax4jsf.component.AjaxViewRoot.broadcastEvents(AjaxViewRoot.java:296)
           at org.ajax4jsf.component.AjaxViewRoot.processPhase(AjaxViewRoot.java:253)
           at org.ajax4jsf.component.AjaxViewRoot.processApplication(AjaxViewRoot.java:466)
           at com.sun.faces.lifecycle.InvokeApplicationPhase.execute(InvokeApplicationPhase.java:82)
           at com.sun.faces.lifecycle.Phase.doPhase(Phase.java:100)
           at com.sun.faces.lifecycle.LifecycleImpl.execute(LifecycleImpl.java:118)
           at javax.faces.webapp.FacesServlet.service(FacesServlet.java:265)
           at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
           at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
           at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:83)
           at org.jboss.seam.web.IdentityFilter.doFilter(IdentityFilter.java:40)
           at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)
           at org.jboss.seam.web.MultipartFilter.doFilter(MultipartFilter.java:90)
           at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)
           at org.jboss.seam.web.ExceptionFilter.doFilter(ExceptionFilter.java:64)
           at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)
           at org.jboss.seam.web.RedirectFilter.doFilter(RedirectFilter.java:45)
           at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)
           at org.ajax4jsf.webapp.BaseXMLFilter.doXmlFilter(BaseXMLFilter.java:177)
           at org.ajax4jsf.webapp.BaseFilter.handleRequest(BaseFilter.java:267)
           at org.ajax4jsf.webapp.BaseFilter.processUploadsAndHandleRequest(BaseFilter.java:380)
           at org.ajax4jsf.webapp.BaseFilter.doFilter(BaseFilter.java:507)
           at org.jboss.seam.web.Ajax4jsfFilter.doFilter(Ajax4jsfFilter.java:56)
           at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)
           at org.jboss.seam.web.LoggingFilter.doFilter(LoggingFilter.java:58)
           at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)
           at it.siag.filter.KerberosFilter.doFilter(KerberosFilter.java:102)
           at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)
           at org.jboss.seam.servlet.SeamFilter.doFilter(SeamFilter.java:158)
           at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
           at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
           at org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(ReplyHeaderFilter.java:96)
           at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
           at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
           at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:230)
           at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:175)
           at org.jboss.web.tomcat.security.SecurityAssociationValve.invoke(SecurityAssociationValve.java:182)
           at org.jboss.web.tomcat.security.JaccContextValve.invoke(JaccContextValve.java:84)
           at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127)
           at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
           at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:562)
           at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
           at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:262)
           at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:844)
           at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:583)
           at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:446)
           at java.lang.Thread.run(Thread.java:619)
      Caused by: javax.persistence.PersistenceException: org.hibernate.exception.GenericJDBCException: Cannot open connection
           at org.hibernate.ejb.AbstractEntityManagerImpl.throwPersistenceException(AbstractEntityManagerImpl.java:629)
           at org.hibernate.ejb.QueryImpl.getSingleResult(QueryImpl.java:99)
           at it.siag.reve.action.RevePersoneHome.isCodiceFiscaleUnique(RevePersoneHome.java:175)
           at it.siag.reve.action.RevePersoneHome.isObjectValid(RevePersoneHome.java:110)
           at it.siag.reve.action.base.RevePersoneBaseHome.update(RevePersoneBaseHome.java:69)
           at it.siag.reve.action.RevePersoneHome.update(RevePersoneHome.java:136)
           at sun.reflect.GeneratedMethodAccessor7428.invoke(Unknown Source)
           at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
           at java.lang.reflect.Method.invoke(Method.java:597)
           at org.jboss.seam.util.Reflections.invoke(Reflections.java:22)
           at org.jboss.seam.intercept.RootInvocationContext.proceed(RootInvocationContext.java:31)
           at org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:56)
           at org.jboss.seam.transaction.RollbackInterceptor.aroundInvoke(RollbackInterceptor.java:28)
           at org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:68)
           at org.jboss.seam.core.BijectionInterceptor.aroundInvoke(BijectionInterceptor.java:77)
           at org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:68)
           at org.jboss.seam.transaction.TransactionInterceptor$1.work(TransactionInterceptor.java:95)
           at org.jboss.seam.util.Work.workInTransaction(Work.java:47)
           at org.jboss.seam.transaction.TransactionInterceptor.aroundInvoke(TransactionInterceptor.java:89)
           at org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:68)
           at org.jboss.seam.core.MethodContextInterceptor.aroundInvoke(MethodContextInterceptor.java:44)
           at org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:68)
           at org.jboss.seam.intercept.RootInterceptor.invoke(RootInterceptor.java:107)
           at org.jboss.seam.intercept.JavaBeanInterceptor.interceptInvocation(JavaBeanInterceptor.java:185)
           at org.jboss.seam.intercept.JavaBeanInterceptor.invoke(JavaBeanInterceptor.java:103)
           at it.siag.reve.action.RevePersoneHome_$$_javassist_28.update(RevePersoneHome_$$_javassist_28.java)
           at sun.reflect.GeneratedMethodAccessor13183.invoke(Unknown Source)
           at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
           at java.lang.reflect.Method.invoke(Method.java:597)
           at org.jboss.el.util.ReflectionUtil.invokeMethod(ReflectionUtil.java:329)
           at org.jboss.el.util.ReflectionUtil.invokeMethod(ReflectionUtil.java:342)
           at org.jboss.el.parser.AstPropertySuffix.invoke(AstPropertySuffix.java:58)
           at org.jboss.el.parser.AstValue.invoke(AstValue.java:96)
           at org.jboss.el.MethodExpressionImpl.invoke(MethodExpressionImpl.java:276)
           at com.sun.facelets.el.TagMethodExpression.invoke(TagMethodExpression.java:68)
           at javax.faces.component.MethodBindingMethodExpressionAdapter.invoke(MethodBindingMethodExpressionAdapter.java:88)
           ... 50 more
      Caused by: org.hibernate.exception.GenericJDBCException: Cannot open connection
           at org.hibernate.exception.SQLStateConverter.handledNonSpecificException(SQLStateConverter.java:103)
           at org.hibernate.exception.SQLStateConverter.convert(SQLStateConverter.java:91)
           at org.hibernate.exception.JDBCExceptionHelper.convert(JDBCExceptionHelper.java:43)
           at org.hibernate.exception.JDBCExceptionHelper.convert(JDBCExceptionHelper.java:29)
           at org.hibernate.jdbc.ConnectionManager.openConnection(ConnectionManager.java:426)
           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:1547)
           at org.hibernate.loader.Loader.doQuery(Loader.java:673)
           at org.hibernate.loader.Loader.doQueryAndInitializeNonLazyCollections(Loader.java:236)
           at org.hibernate.loader.Loader.doList(Loader.java:2220)
           at org.hibernate.loader.Loader.listIgnoreQueryCache(Loader.java:2104)
           at org.hibernate.loader.Loader.list(Loader.java:2099)
           at org.hibernate.loader.hql.QueryLoader.list(QueryLoader.java:378)
           at org.hibernate.hql.ast.QueryTranslatorImpl.list(QueryTranslatorImpl.java:338)
           at org.hibernate.engine.query.HQLQueryPlan.performList(HQLQueryPlan.java:172)
           at org.hibernate.impl.SessionImpl.list(SessionImpl.java:1121)
           at org.hibernate.impl.QueryImpl.list(QueryImpl.java:79)
           at org.hibernate.ejb.QueryImpl.getSingleResult(QueryImpl.java:80)
           ... 84 more
      Caused by: 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=TransactionImple < ac, BasicAction: 7f000001:c929:4a63fef6:c412 status: ActionStatus.ABORT_ONLY >); - 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=TransactionImple < ac, BasicAction: 7f000001:c929:4a63fef6:c412 status: ActionStatus.ABORT_ONLY >))
           at org.jboss.resource.adapter.jdbc.WrapperDataSource.getConnection(WrapperDataSource.java:95)
           at org.hibernate.connection.DatasourceConnectionProvider.getConnection(DatasourceConnectionProvider.java:69)
           at org.hibernate.jdbc.ConnectionManager.openConnection(ConnectionManager.java:423)
           ... 98 more
      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=TransactionImple < ac, BasicAction: 7f000001:c929:4a63fef6:c412 status: ActionStatus.ABORT_ONLY >)
           at org.jboss.resource.connectionmanager.TxConnectionManager.managedConnectionReconnected(TxConnectionManager.java:358)
           at org.jboss.resource.connectionmanager.BaseConnectionManager2.reconnectManagedConnection(BaseConnectionManager2.java:524)
           at org.jboss.resource.connectionmanager.BaseConnectionManager2.allocateConnection(BaseConnectionManager2.java:405)
           at org.jboss.resource.connectionmanager.BaseConnectionManager2$ConnectionManagerProxy.allocateConnection(BaseConnectionManager2.java:849)
           at org.jboss.resource.adapter.jdbc.WrapperDataSource.getConnection(WrapperDataSource.java:89)
           ... 100 more
      Caused by: javax.transaction.SystemException: java.lang.Throwable: Unabled to enlist resource, see the previous warnings. tx=TransactionImple < ac, BasicAction: 7f000001:c929:4a63fef6:c412 status: ActionStatus.ABORT_ONLY >
           at org.jboss.resource.connectionmanager.TxConnectionManager$TxConnectionEventListener$TransactionSynchronization.checkEnlisted(TxConnectionManager.java:759)
           at org.jboss.resource.connectionmanager.TxConnectionManager$TxConnectionEventListener.enlist(TxConnectionManager.java:592)
           at org.jboss.resource.connectionmanager.TxConnectionManager.managedConnectionReconnected(TxConnectionManager.java:352)
           ... 104 more



      Any ideas what the problem could be? I use an Oracle-DB with a local-tx-datasource:

      <datasources>
         <!--  see http://www.jboss.org/community/docs/DOC-12246 -->
         <local-tx-datasource>
            <jndi-name>reveDatasource</jndi-name>
            <connection-url>jdbc:oracle:thin:@(DESCRIPTION =
               (ADDRESS = (PROTOCOL = TCP)(HOST = host1)(PORT = 1521))
               (ADDRESS = (PROTOCOL = TCP)(HOST = host1)(PORT = 1521))
               (CONNECT_DATA =
                 (SERVER = DEDICATED)
                 (SERVICE_NAME = my_service_name)
               ))
            </connection-url>
            <driver-class>oracle.jdbc.OracleDriver</driver-class>
            <user-name>my_user</user-name>
            <password>my_password</password>
            <min-pool-size>1</min-pool-size>
            <max-pool-size>10</max-pool-size>
           
            <idle-timeout-minutes>30</idle-timeout-minutes>
            <check-valid-connection-sql>select * from dual</check-valid-connection-sql>
           
         </local-tx-datasource>


      Thanks
      Matthias
        • 1. Re: Transaction problem: Could not enlist in transaction
          asookazian

          This can happen when you have more than one datasource (and thus more than one EntityManager) used in the same class and no XA datasources configured: http://www.jboss.org/index.html?module=bb&op=viewtopic&p=4125680#4125680


          You must use XA datasources if you are accessing two or more databases in the same query or when method A calls method B and both require a tx.  If the TransactionAttributeType is REQUIRED for two methods in the component, and EJB tries to enlist the resource via tx propagation from method A to method B, and you are not using XA datasources, then you will see your (difficult to decipher) exception or similar.


          There is a JBoss Wiki on this exception, google around for it.


          But not sure if that helps your case b/c it looks like you are only using one datasource so XA is not the issue here.


          Post the code that is throwing that exception if possible.

          • 2. Re: Transaction problem: Could not enlist in transaction
            asookazian
            • 3. Re: Transaction problem: Could not enlist in transaction
              magix

              yes I'm using only 1 datasource / 1 EntityManager.
              But the Database I'm using is an Oracle RAC (with 2 nodes - se connection URL in my original post above) so now I wonder whether in this case I have to treat it like a XA-resource?
              Has anyone tried to connect to a Oracle RAC with Seam/JPA/POJOs?
              The strange thing is that the errors happen only after some time - not in a reproducable way.


              • 4. Re: Transaction problem: Could not enlist in transaction
                asookazian

                Sorry, we use MSSQL, so not very familiar with Oracle ds.


                <connection-url>jdbc:oracle:thin:@(DESCRIPTION =
                     (ADDRESS = (PROTOCOL = TCP)(HOST = host1)(PORT = 1521))
                     (ADDRESS = (PROTOCOL = TCP)(HOST = host1)(PORT = 1521))
                     (CONNECT_DATA =
                       (SERVER = DEDICATED)
                       (SERVICE_NAME = my_service_name)
                     ))
                      </connection-url>



                I noticed in the above xml snippet that host1 appears twice and the port is the same.  Two duplicate entries?  Is that supposed to be like that?


                And did you use 1 node or 2 node setup in your non-prod envmts that did not have this problem?



                The strange thing is that the errors happen only after some time - not in a reproducable way.

                That's the problem and the fact that the exception is jibberish to me.  JBoss needs to address/fix this actual exception verbage and be more human-friendly and specific.

                • 5. Re: Transaction problem: Could not enlist in transaction
                  magix
                  Sorry, there's a mistake in my snippet,
                  there are 2 different hosts:

                  <connection-url>jdbc:oracle:thin:@(DESCRIPTION =
                       (ADDRESS = (PROTOCOL = TCP)(HOST = host1)(PORT = 1521))
                       (ADDRESS = (PROTOCOL = TCP)(HOST = host2)(PORT = 1521))
                       (CONNECT_DATA =
                         (SERVER = DEDICATED)
                         (SERVICE_NAME = my_service_name)
                       ))
                  </connection-url>

                  But the configured oracle service my_service_name is configured in such a way that I use always the same node of the cluster.


                  I read here
                  https://forum.hibernate.org/viewtopic.php?f=1&t=995754&p=2409096
                  that someone had a similiar problem with FlushMode=MANUAL.
                  I use long-running conversations with FlushMode=Manual, perhaps this causes the problem under certain circumstances?
                  Perhaps if the flush doesn't finish correctly because of a unique-key-constraint error (I found such messages in my logs too), the connection is not cleaned up / rolled back properly and remains marked as ABORT_ONLY? So the next user getting this connection from the pool gets this error?
                  Just guessing blindly ...

                  And thank you Arbi for your help!

                  • 6. Re: Transaction problem: Could not enlist in transaction
                    asookazian

                    Matthias Age wrote on Jul 25, 2009 14:18:


                    I read here
                    https://forum.hibernate.org/viewtopic.php?f=1&t=995754&p=2409096
                    that someone had a similiar problem with FlushMode=MANUAL.
                    I use long-running conversations with FlushMode=Manual, perhaps this causes the problem under certain circumstances?
                    Perhaps if the flush doesn't finish correctly because of a unique-key-constraint error (I found such messages in my logs too), the connection is not cleaned up / rolled back properly and remains marked as ABORT_ONLY? So the next user getting this connection from the pool gets this error?
                    Just guessing blindly ...

                    And thank you Arbi for your help!




                    That was my post (yes, I'm a very big Skinny Puppy fan!)


                    So nobody replied to that post but I think it is an important topic of discussion.


                    I still don't understand what exactly the root cause of that exception is.  In other words, in my case, why is the tx not active?


                    Or in your case, why wasn't it able to enlist resource?  And what does

                    tx=TransactionImple < ac

                    mean?


                    And it's the transaction that is aborted, not the connection.


                    I just looked at my code (and I haven't actually executed this code in a while, so beware) but it looks like I solved my problem by using REQUIRES_NEW and using AUTO flush (default):


                    @Begin(join=true)
                            @TransactionAttribute(TransactionAttributeType.NOT_SUPPORTED)
                            public void searchSerialNumbers()
                            {       
                    ...
                    bulkCreateRepairCaseSupport.persist(serialNumber, topOneWorkOrdersList);
                    ...
                    
                    }



                    @TransactionAttribute(TransactionAttributeType.REQUIRES_NEW)
                            public void persist(String seralNumber, List<BulkCreateWorkOrdersBean> topOneWorkOrdersList) throws ApplicationUserException
                            {...}



                    I'm not sure if this is recommended or not for two reasons:


                    1) no more manual flush
                    2) first method does not run inside a tx


                    But most likely it avoided the exception we're seeing.


                    Someone needs to write a wiki on this, either from a Hibernate or Seam/Hibernate perspective (in any event how to handle this scenario when you're using manual flush).  And that's assuming that manual flush is involved in the root cause...


                    In your case, try turning off manual flush and see if that helps or not.

                    • 7. Re: Transaction problem: Could not enlist in transaction
                      asookazian

                      I downloaded JBoss 4.2.3-src.


                      TxConnectionManager.java:


                      /**
                                * Get the result of the enlistment
                                * 
                                * @throws SystemExeption for any error
                                */
                               public void checkEnlisted() throws SystemException
                               {
                                  if (enlistError != null)
                                  {
                                     String error = "Error enlisting resource in transaction=" + currentTx;
                                     if (trace)
                                        log.trace(error + " " + TxConnectionEventListener.this);
                      
                                     // Wrap the error to give a reasonable stacktrace since the resource
                                     // could have been enlisted by a different thread
                                     if (enlistError == FAILED_TO_ENLIST)
                                        throw new SystemException(FAILED_TO_ENLIST + " tx=" + currentTx);
                                     else
                                     {
                                        SystemException e = new SystemException(error);
                                        e.initCause(enlistError);
                                        throw e;
                                     }
                                  }
                                  if (enlisted == false)
                                  {
                                     String error = "Resource is not enlisted in transaction=" + currentTx;
                                     if (trace)
                                        log.trace(error + " " + TxConnectionEventListener.this);
                                     throw new IllegalStateException("Resource was not enlisted.");
                                  }
                               }



                      checkEnlisted() is in a private class:


                      private class TransactionSynchronization implements Synchronization
                            {
                               /** Transaction */
                               private Transaction currentTx;
                               
                               /** This is the status when we were registered */
                               private boolean wasTrackByTx;
                      
                               /** Whether we are enlisted */
                               private boolean enlisted = false;
                               
                               /** Any error during enlistment */
                               private Throwable enlistError;
                               
                               /**
                                * Create a new TransactionSynchronization.
                                * 
                                * @param trackByTx whether this is track by connection
                                */
                               public TransactionSynchronization(Transaction tx, boolean trackByTx)
                               {
                                  this.currentTx = tx;
                                  wasTrackByTx = trackByTx;
                               }
                               
                               /**
                                * Get the result of the enlistment
                                * 
                                * @throws SystemExeption for any error
                                */
                               public void checkEnlisted() throws SystemException



                      Also, this from the comments at the top of the file may be helpful:


                       *3. When a transaction begun notification is received from the
                       * UserTransaction (via the CachedConnectionManager, all
                       * managedConnections associated with the current object must be
                       * enlisted in the transaction.
                       *  Entry point: (from
                       * CachedConnectionManager)
                       * ConnectionCacheListener.transactionStarted(Transaction,
                       * Collection). The collection is of ConnectionRecord objects.
                       * written.



                      So looking at your call stack, here was the order of events:


                      1)  org.jboss.resource.connectionmanager.TxConnectionManager.managedConnectionReconnected(TxConnectionManager.java:352)
                      2)  org.jboss.resource.connectionmanager.TxConnectionManager$TxConnectionEventListener.enlist(TxConnectionManager.java:592)
                      3)org.jboss.resource.connectionmanager.TxConnectionManager$TxConnectionEventListener$TransactionSynchronization.checkEnlisted(TxConnectionManager.java:759)



                      protected void managedConnectionReconnected(ConnectionListener cl) throws ResourceException
                         {
                            try
                            {
                               cl.enlist();
                            }
                            catch (Throwable t)
                            {
                               if (trace)
                                  log.trace("Could not enlist in transaction on entering meta-aware object! " + cl, t);
                               throw new JBossResourceException("Could not enlist in transaction on entering meta-aware object!", t);
                            }
                         }



                      Unfortunately, the only way to really know exactly what is happening is to add breakpoints in the debugger for this JBoss TxConnectionManager code and step thru.  But the problem is that the exception is difficult to reproduce and it only seems to occur in prod (right?)

                      • 8. Re: Transaction problem: Could not enlist in transaction
                        mphoenix

                        Remove the reference to isSpecCompliant


                        This can be a in the following files
                            jbossjca-service.xml
                            transaction-service.xml    


                        This is a badly named setting and should be avoided!!


                        The result is connections are closed and reopened and transactions span different conections.
                        Hence the error Could not enlist in transaction on entering meta-aware object


                        See dark comments below about this setting


                        Memory Leak


                        CachedConnectionManager