1 Reply Latest reply on Sep 15, 2006 11:30 AM by vakuthota

    enlist problem

    Johan Romme Newbie

      Hi all,

      Every now and then, say once a week we have a problem with enlisting? a transaction, for example see the following stacktrace.

      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=nldbld1/1526, BranchQual=, localId=1526]); - nested throwable: (org.jboss.resource.JBossResou
      rceException: 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=nldbld1/1526, BranchQual=, localId=1526]))
       at org.jboss.resource.adapter.jdbc.WrapperDataSource.getConnection(WrapperDataSource.java:94)
       at org.springframework.orm.hibernate3.LocalDataSourceConnectionProvider.getConnection(LocalDataSourceConnectionProvider.java:80)
       at org.hibernate.jdbc.ConnectionManager.openConnection(ConnectionManager.java:298)
       at org.hibernate.jdbc.ConnectionManager.getConnection(ConnectionManager.java:110)
       at org.hibernate.jdbc.AbstractBatcher.prepareQueryStatement(AbstractBatcher.java:88)
       at org.hibernate.loader.Loader.prepareQueryStatement(Loader.java:1162)
       at org.hibernate.loader.Loader.doQuery(Loader.java:390)
       at org.hibernate.loader.Loader.doQueryAndInitializeNonLazyCollections(Loader.java:218)
       at org.hibernate.loader.Loader.loadEntity(Loader.java:1345)
       at org.hibernate.loader.entity.EntityLoader.load(EntityLoader.java:116)
       at org.hibernate.loader.entity.EntityLoader.load(EntityLoader.java:101)
       at org.hibernate.persister.entity.BasicEntityPersister.load(BasicEntityPersister.java:2471)
       at org.hibernate.event.def.DefaultLoadEventListener.loadFromDatasource(DefaultLoadEventListener.java:351)
       at org.hibernate.event.def.DefaultLoadEventListener.doLoad(DefaultLoadEventListener.java:332)
       at org.hibernate.event.def.DefaultLoadEventListener.load(DefaultLoadEventListener.java:113)
       at org.hibernate.event.def.DefaultLoadEventListener.proxyOrLoad(DefaultLoadEventListener.java:151)
       at org.hibernate.event.def.DefaultLoadEventListener.onLoad(DefaultLoadEventListener.java:79)
       at org.hibernate.impl.SessionImpl.load(SessionImpl.java:603)
       at org.hibernate.impl.SessionImpl.load(SessionImpl.java:596)
       at org.springframework.orm.hibernate3.HibernateTemplate$CloseSuppressingInvocationHandler.invoke(HibernateTemplate.java:1025)
       at $Proxy222.load(Unknown Source)
       at nl.elegant.lottery.batch.management.dao.hibernate.HibernateManagedBatchDao$4.doInHibernate(HibernateManagedBatchDao.java:217)
      <cut/>
      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=nldbld1/1526, BranchQual=, localId=1526])
       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)
       ... 68 more
      Caused by: javax.transaction.SystemException: java.lang.Throwable: Unabled to enlist resource, see the previous warnings. tx=TransactionImpl:XidImpl[FormatId=257, GlobalId=nldbld1/1526, BranchQual=, localId=1526]
       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)
       ... 72 more
      


      We have some 20 environments running development cycles, testing environments (manual and automated) and (pre-)production.

      We have an oracle9206 database and use the oracle10.2.0.1 jdbc driver.
      We use jboss-404GA, hibernate305, spring, EJB's and CMT
      At this moment we do not use jbossTransactions.
      We have 6 datasource 5 of which are XA.

      Recently we upgraded from jboss403sp1 and had hoped the enlist problem would disappear.

      As said the error occurs about once a week in one of the environments, is not reproducable, does not always occur at the same spot in our application and seems to occur when the system is busy (high cpu-load).

      Searching jboss-forums and other resources does not give the solution, all suggestions we have tried. Maybe someone at this forum has an answer, or should we start using JbossTransactions...

      Thanks in advance.

        • 1. Re: enlist problem
          vakuthota Newbie

          Hi guys,

          This problem is because Oracle database is not XA compliant, thus throwing the following exception

          OracleXAException: XAER_RMERR (Internal XA Error).

          Reason for problem:

          The error is that the transaction manager was unable to convert the transaction to an XA transaction. Specifically, Oracle returned an error XAER_RMERR, error code number 65535. ORA-65535 is not a valid error code and XAER_RMERR essentially means that something went wrong with XA. What this indicates is that your Oracle database is not configured to support XA transactions. Therefore, when the WebSphere Application Server transaction manager instructs the Oracle transaction manager to participate in this XA transaction, Oracle cannot comply and throws this exception

          Solution :

          The solution is to run two scripts that are included in the Oracle install. This will likely need to be performed by your Oracle DBA, since you must be logged into Oracle as SYSOPER or SYSDBA in order to have the necessary permissions for these scripts to work. The scripts are:

          directory: <ORACLE_HOME>\javavm\install
          file:initxa.sql
          file: initjvm.sql
          The initxa.sql script configures the database for XA. Once it runs successfully, your database is configured for XA. The script may run successfully the first time you try. Unfortunately, it probably will not run successfully because some of the database's memory spaces are too small. To fix this, run the initjvm.sql script. It will probably fail too, but in doing so it will indicate which parameters need to be adjusted. The parameters are stored in this file:

          directory: <ORACLE_HOME>\database
          file: init<DATABASE_SID>.ora

          This table shows two parameters that typically need to be increased. Your particular database configuration may require adjusting different parameters.

          Oracle Initialization Values

          Parameter Name Minimum Value
          java_pool_size 12000000
          shared_pool_size 24000000

          Once initjvm.sql runs successfully, then initxa.sql should run successfully. The Oracle database will need to be restarted for the changes to take effect.

          And for XA_Recovery, following grants must be given by SYSDBA :

          grant select on DBA_PENDING_TRANSACTIONS to PUBLIC

          You can see more details information from the following link :

          http://www-128.ibm.com/developerworks/websphere/library/techarticles/0407_woolf/0407_woolf.html?ca=dnp-327Scroll