7 Replies Latest reply on Oct 30, 2002 6:53 AM by vickyk

    Could not enlist in transaction on entering meta-aware objec

      Getting the following when attempting to retrieve a connection from the connection data source via a simple

      dataSrc.getConnection();

      call. Running JBoss 3.0.2. Any ideas?


      13:56:13,859 INFO [LocalTxConnectionManager] Could not enlist in transaction on entering meta-aware object!
      javax.transaction.SystemException: Could not enlist XAResource!javax.transaction.RollbackException: Already marked for rollback
      at org.jboss.resource.connectionmanager.LocalTxConnectionManager$LocalConnectionEventListener.enlist(LocalTxConnectionManager.java:329)
      at org.jboss.resource.connectionmanager.LocalTxConnectionManager.managedConnectionReconnected(LocalTxConnectionManager.java:255)
      at org.jboss.resource.connectionmanager.BaseConnectionManager2.allocateConnection(BaseConnectionManager2.java:534)
      at org.jboss.resource.connectionmanager.BaseConnectionManager2$ConnectionManagerProxy.allocateConnection(BaseConnectionManager2.java:812)
      at org.jboss.resource.adapter.jdbc.local.LocalDataSource.getConnection(LocalDataSource.java:102)

        • 1. Re: Could not enlist in transaction on entering meta-aware o

          Hmm, well. Taking a look at JBoss 3.0.3, I see the following:

          Revision 1.34.2.8 / (view) - annotate - [select for diffs] , Wed Sep 25 18:39:22 2002 UTC (5 days, 23 hours ago) by patriot1burke
          Branch: Branch_3_0
          CVS Tags: JBoss_3_0_3
          Changes since 1.34.2.7: +5 -1 lines
          Diff to previous 1.34.2.7 to branch point 1.34 to next main 1.35
          call Thread.interrupted on disassociation to clear a marked for rollback interrupt. We
          want to avoid putting an interrupted thread in a thread pool


          Anyone want to confirm that my diagnosis is a likelihood?

          • 2. Re: Could not enlist in transaction on entering meta-aware o

            Ok, so I downloaded 3.0.3 and installed it with great hopes for it fixing my problem. No such joy. I get exactly the same error message.

            Anybody got any thoughts?

            • 3. Re: Could not enlist in transaction on entering meta-aware o
              davidjencks

              Ummm its a dumb question but are you certain that your transaction is not marked for rollback?

              • 4. Re: Could not enlist in transaction on entering meta-aware o
                jlmartinez

                The big problem...
                We have had that problem for a long time and we have not found solution for CMT.

                So, the advice is that delege the transactions to the database. that works correctly.

                conn.setAutoCommit(false);
                //sentences
                conn.commit();

                • 5. Re: Could not enlist in transaction on entering meta-aware o
                  raj_kkp

                  Hi ,
                  I am getting same the error. I am using jboss 3.0.3 and oracle. My connection pool works fine but occasionally it start throwing an error---->

                  org.jboss.util.NestedSQLException: Could not enlist in transaction on entering meta-aware object !
                  javax.transaction.SystemException: Could not enlist XAResource! .......

                  I am closing all ResultSet, Statements and Connection in finnaly method.

                  Can any one suggest some solution?

                  Thanks in advance.

                  • 6. Re: Could not enlist in transaction on entering meta-aware o
                    vickyk

                    > Hi ,
                    > I am getting same the error. I am using jboss 3.0.3
                    > and oracle. My connection pool works fine but
                    > occasionally it start throwing an error---->
                    >
                    > org.jboss.util.NestedSQLException: Could not enlist
                    > in transaction on entering meta-aware object !
                    > javax.transaction.SystemException: Could not enlist
                    > XAResource! .......
                    >
                    > I am closing all ResultSet, Statements and Connection
                    > in finnaly method.
                    >
                    > Can any one suggest some solution?
                    >
                    > Thanks in advance.

                    • 7. Re: Could not enlist in transaction on entering meta-aware o
                      vickyk

                      Hi,
                      > I am getting same the error. I am using jboss 3.0.3
                      > and oracle. My connection pool works fine but
                      > occasionally it start throwing an error
                      >
                      > org.jboss.util.NestedSQLException: Could not enlist
                      > in transaction on entering meta-aware object !
                      > javax.transaction.SystemException: Could not enlist
                      > XAResource! .......
                      >
                      > I am closing all ResultSet, Statements and Connection
                      > in finnaly method.
                      I think you are trying to refresh the page very fast and it just opens the other Transaction before Closing the older one,the default time for ending the transaction is 300 secinds which is specified in the jboss-server.xml.
                      Try setting the transaction in the code by
                      setTransactionTimeout(10) and see the results.....
                      In fact it is happenning to my app also ,I am trying to get the XSDataSource from the JNDI.After getting the special DataSource I am going for the Transaction with JTA but once it does not make the changes.....
                      I will give the code snipper
                      **********************************************************
                      Context ocontext=new InitialContext();
                      DataSource ods=(DataSource)ocontext.lookup("java:/XAOracleDS");
                      //DataSource ods=(DataSource)ocontext.lookup("java:/OracleDSI");
                      System.out.println("Data Source is "+ods);
                      System.out.println("Before getting UserTransaction");


                      Connection ocon=ods.getConnection();
                      //ocon.setAutoCommit(true);
                      PreparedStatement ostmt=ocon.prepareStatement("update gangsterejb set name=? where id = ? ");
                      ostmt.setString(1,"VK1");
                      ostmt.setString(2,"3");
                      ostmt.executeUpdate();
                      UserTransaction trans=(UserTransaction)ocontext.lookup("UserTransaction");
                      //ResultSet ors=ostmt.executeQuery("select * from tab");
                      int i=10;
                      trans.setTransactionTimeout(60);
                      System.out.println("After Timeout");
                      out.println("Value Of i before begin:"+i+"");
                      trans.begin();
                      System.out.println("After Begin");
                      //trans.setRollbackOnly();
                      System.out.println("STATUS_ACTIVE "+Status.STATUS_ACTIVE);
                      System.out.println("Get Status "+trans.getStatus());
                      //ostmt.executeUpdate("update gangsterejb set name='1' where id = 3 ");
                      System.out.println("After update");
                      i++;
                      //trans.commit();
                      System.out.println("Before Commit "+ocon.getAutoCommit());
                      //trans.rollback();
                      trans.commit();
                      System.out.println("After Commit");
                      **********************************************************

                      regards
                      Vicky