0 Replies Latest reply on Sep 17, 2001 7:39 PM by Nishant

    transaction deadlock

    Nishant Newbie

      Hi.
      In regards to my previous post where I wrote:
      My client program starts multiple thread each creating
      'n' number of components. Each thread invokes create method on the bean. However I get exceptions. I guess i need to make some configurational changes in my jboss.jcml where I am creating connection pool.
      However I do not know what?
      Any pointers?
      BTW, when I run with single thread, it works just fine. When no. of threads is 2 or more exceptions are thrown.

      I specify the following configuration in my jboss.jcml:
      bean code="org.jboss.jdbc.XADataSourceLoader" name="DefaultDomain:service=XADataSource,name=SQLPool">
      org.opentools.minerva.jdbc.xa.wrapper.XADataSourceImpl
      SQLPool
      host=Ares; database=StateComponentDB
      jdbc:inetdae7:Ares
      sa

      0
      true
      false
      false
      true
      120000
      1800000
      false
      false
      1.0
      0


      Note that I have made MaxSize = 0.
      Also in my deployment descriptor I specify the following transaction property:
      <container-transaction>

      <ejb-name>StateComponentBean</ejb-name>
      <method-name>*</method-name>

      <trans-attribute>RequiresNew</trans-attribute>
      </container-transaction>

      I get the exception:
      StateComponentBean] XAException: tx=XidImpl [FormatId=257, GlobalId=cassini//5,
      BranchQual=] errorCode=XAER_NOTA
      [StateComponentBean] javax.transaction.xa.XAException
      [StateComponentBean] at org.opentools.minerva.jdbc.xa.wrapper.XAResourceImpl.
      start(XAResourceImpl.java:258)
      ........ etc that I had specified in my previous post but, this exception does not occur everytime.
      However I consistently get the following exception.
      Stack Trace:
      [EntitySynchronizationInterceptor] Store failed
      java.rmi.ServerException: Store failed; nested exception is:
      java.sql.SQLException: [ARES]Your transaction (process ID #7) was dead
      cked with another process and has been chosen as the deadlock victim. Rerun yo
      transaction.
      java.sql.SQLException: [ARES]Your transaction (process ID #7) was deadlocked w
      h another process and has been chosen as the deadlock victim. Rerun your trans
      tion.
      at com.inet.tds.a.a(Unknown Source)
      at com.inet.tds.b.for(Unknown Source)
      at com.inet.tds.b.executeUpdate(Unknown Source)
      at org.opentools.minerva.jdbc.PreparedStatementInPool.executeUpdate(Pr
      aredStatementInPool.java:82)
      at org.jboss.ejb.plugins.jaws.jdbc.JDBCUpdateCommand.executeStatementA
      HandleResult(JDBCUpdateCommand.java:49)
      at org.jboss.ejb.plugins.jaws.jdbc.JDBCCommand.jdbcExecute(JDBCCommand
      ava:160)
      at org.jboss.ejb.plugins.jaws.jdbc.JDBCStoreEntityCommand.execute(JDBC
      oreEntityCommand.java:97)
      at org.jboss.ejb.plugins.jaws.JAWSPersistenceManager.storeEntity(JAWSP
      sistenceManager.java:168)
      at org.jboss.ejb.plugins.CMPPersistenceManager.storeEntity(CMPPersiste
      eManager.java:397)
      at org.jboss.ejb.EntityContainer.storeEntity(EntityContainer.java:252)
      at org.jboss.ejb.plugins.EntitySynchronizationInterceptor$InstanceSync
      onization.beforeCompletion(EntitySynchronizationInterceptor.java:400)
      at org.jboss.tm.TxCapsule.doBeforeCompletion(TxCapsule.java:1210)
      at org.jboss.tm.TxCapsule.commit(TxCapsule.java:304)
      at org.jboss.tm.TransactionImpl.commit(TransactionImpl.java:76)
      at org.jboss.ejb.plugins.TxInterceptorCMT.runWithTransactions(TxInterc
      torCMT.java:521)
      at org.jboss.ejb.plugins.TxInterceptorCMT.invokeHome(TxInterceptorCMT.
      va:86)
      at org.jboss.ejb.plugins.SecurityInterceptor.invokeHome(SecurityInterc
      tor.java:103)
      at org.jboss.ejb.plugins.LogInterceptor.invokeHome(LogInterceptor.java
      06)
      at org.jboss.ejb.EntityContainer.invokeHome(EntityContainer.java:420)
      at org.jboss.ejb.plugins.jrmp.server.JRMPContainerInvoker.invokeHome(J
      PContainerInvoker.java:370)
      at java.lang.reflect.Method.invoke(Native Method)
      at sun.rmi.server.UnicastServerRef.dispatch(Unknown Source)
      at sun.rmi.transport.Transport$1.run(Unknown Source)
      at java.security.AccessController.doPrivileged(Native Method)
      at sun.rmi.transport.Transport.serviceCall(Unknown Source)
      at sun.rmi.transport.tcp.TCPTransport.handleMessages(Unknown Source)
      at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run(Unknown So
      ce)
      at java.lang.Thread.run(Unknown Source)