4 Replies Latest reply on Aug 20, 2002 10:34 AM by Eric Chen

    Transaction XidImpl timed out when performing large number o

    Eric Chen Newbie

      Hi,

      I'm not sure if this is the correct forum to post this message to (please let me know if it isn't) however I'm having the following problem. When I attempt to create a large amount of entity beans within a session bean (which runs under a container managed transaction) after a while (about 13,000 entries) the program slows down and it eventual terminates with either a out of memory message or with the stack trace below. The code that I'm running here is only a test program that just continuously creates new entity beans. The actual code that I want to run has a bunch of queries and creates a number of EJBs and relations per record and it seems to crash at around 1200 records. Either way I get the same error message. I've also tried using bean managed transactions and committing after not that many records and the problem still occurs. Running the application against JProfileIt really doesn't seem to show anything intersting either other than it spending most of it's time in the persistanceManager.createEntity function and getting connections.

      I'm wondering if it's because this transaction is taking too long and it's timing out. This thing will have to run at least over 5 mins which I think is the default timeout of the transaction manager. I can't seem to find it in the documentation as to where I can set the default timeout of the transaction manager. Finally the one thing that seems to be occuring is that application really slows down right before it throws an exception (as shown in the output). Is this because the transaction's about to timeout or is it caused by something else. This is being run using JBoss 3.0.1, using the DB2 JCA service to connect to a DB2 database running on the same machine. I'm new to developing J2EE apps and am at a loss as to what's causing this any any help would really be appreciated.

      Eric

      Stack Trace:

      2002-08-18 16:34:32,080 INFO [edu.jhu.cmbl.arraydb.ejb.sequence.SequenceManagerBean] Loop at 12500
      2002-08-18 16:34:35,655 INFO [edu.jhu.cmbl.arraydb.ejb.sequence.SequenceManagerBean] Loop at 12600
      2002-08-18 16:34:37,858 INFO [edu.jhu.cmbl.arraydb.ejb.sequence.SequenceManagerBean] Loop at 12700
      2002-08-18 16:34:39,981 INFO [edu.jhu.cmbl.arraydb.ejb.sequence.SequenceManagerBean] Loop at 12800
      2002-08-18 16:34:43,576 INFO [edu.jhu.cmbl.arraydb.ejb.sequence.SequenceManagerBean] Loop at 12900
      2002-08-18 16:34:50,346 INFO [edu.jhu.cmbl.arraydb.ejb.sequence.SequenceManagerBean] Loop at 13000
      2002-08-18 16:34:57,096 INFO [edu.jhu.cmbl.arraydb.ejb.sequence.SequenceManagerBean] Loop at 13100
      2002-08-18 16:35:06,890 INFO [edu.jhu.cmbl.arraydb.ejb.sequence.SequenceManagerBean] Loop at 13200
      2002-08-18 16:35:32,316 INFO [edu.jhu.cmbl.arraydb.ejb.sequence.SequenceManagerBean] Loop at 13300
      ***2002-08-18 16:38:13,789 WARN [org.jboss.tm.TxCapsule] Transaction XidImpl [FormatId=257, GlobalId=ecserv//29, BranchQual=] timed out. status=STATUS_ACTIVE
      2002-08-18 16:38:26,146 INFO [org.jboss.resource.connectionmanager.LocalTxConnectionManager$LocalConnectionEventListener] Could not enlist XAResource!
      javax.transaction.RollbackException: Already marked for rollback
      at org.jboss.tm.TxCapsule.enlistResource(TxCapsule.java:629)
      at org.jboss.tm.TransactionImpl.enlistResource(TransactionImpl.java:102)
      at org.jboss.resource.connectionmanager.LocalTxConnectionManager$LocalConnectionEventListener.enlist(LocalTxConnectionManager.java:320)
      at org.jboss.resource.connectionmanager.LocalTxConnectionManager.managedConnectionReconnected(LocalTxConnectionManager.java:255)
      at org.jboss.resource.connectionmanager.BaseConnectionManager2.allocateConnection(BaseConnectionManager2.java:534)
      at org.jboss.resource.adapter.jdbc.local.LocalDataSource.getConnection(LocalDataSource.java:102)
      at org.jboss.ejb.plugins.cmp.jdbc.JDBCCreateEntityCommand.insertEntity(JDBCCreateEntityCommand.java:182)
      at org.jboss.ejb.plugins.cmp.jdbc.JDBCCreateEntityCommand.execute(JDBCCreateEntityCommand.java:131)
      at org.jboss.ejb.plugins.cmp.jdbc.JDBCStoreManager.createEntity(JDBCStoreManager.java:527)
      at org.jboss.ejb.plugins.CMPPersistenceManager.createEntity(CMPPersistenceManager.java:253)
      at org.jboss.resource.connectionmanager.CachedConnectionInterceptor.createEntity(CachedConnectionInterceptor.java:270)
      at org.jboss.ejb.EntityContainer.createLocalHome(EntityContainer.java:579)
      at java.lang.reflect.Method.invoke(Native Method)
      at org.jboss.ejb.EntityContainer$ContainerInterceptor.invokeHome(EntityContainer.java:1116)
      at org.jboss.ejb.plugins.AbstractInterceptor.invokeHome(AbstractInterceptor.java:73)
      at org.jboss.ejb.plugins.EntitySynchronizationInterceptor.invokeHome(EntitySynchronizationInterceptor.java:209)
      at org.jboss.resource.connectionmanager.CachedConnectionInterceptor.invokeHome(CachedConnectionInterceptor.java:215)
      at org.jboss.ejb.plugins.EntityInstanceInterceptor.invokeHome(EntityInstanceInterceptor.java:88)
      at org.jboss.ejb.plugins.EntityLockInterceptor.invokeHome(EntityLockInterceptor.java:79)
      at org.jboss.ejb.plugins.EntityCreationInterceptor.invokeHome(EntityCreationInterceptor.java:44)
      at org.jboss.ejb.plugins.AbstractTxInterceptor.invokeNext(AbstractTxInterceptor.java:111)
      at org.jboss.ejb.plugins.TxInterceptorCMT.runWithTransactions(TxInterceptorCMT.java:178)
      at org.jboss.ejb.plugins.TxInterceptorCMT.invokeHome(TxInterceptorCMT.java:52)
      at org.jboss.ejb.plugins.SecurityInterceptor.invokeHome(SecurityInterceptor.java:105)
      at org.jboss.ejb.plugins.LogInterceptor.invokeHome(LogInterceptor.java:129)
      at org.jboss.ejb.EntityContainer.invokeHome(EntityContainer.java:487)
      at org.jboss.ejb.plugins.local.BaseLocalContainerInvoker.invokeHome(BaseLocalContainerInvoker.java:230)
      at org.jboss.ejb.plugins.local.LocalHomeProxy.invoke(LocalHomeProxy.java:110)
      at $Proxy78.create(Unknown Source)
      at edu.jhu.cmbl.arraydb.ejb.sequence.SequenceManagerBean.loadSequenceAnnotation(SequenceManagerBean.java:184)
      at java.lang.reflect.Method.invoke(Native Method)
      at org.jboss.ejb.StatelessSessionContainer$ContainerInterceptor.invoke(StatelessSessionContainer.java:660)
      at org.jboss.resource.connectionmanager.CachedConnectionInterceptor.invoke(CachedConnectionInterceptor.java:186)