2 Replies Latest reply on Apr 29, 2002 9:09 AM by Brian Dobby

    Problem: Tx shared between threads: JBoss 2.4.3 & JSQLConnec

    Brian Dobby Newbie

      Hi, we seem to have a situation where calls to JBoss from 2 threads of the same client app are getting the same transaction when getting connections from the same pool. Both threads are calling stateless session beans, one with BMT and one with CMT. Log output from TxCapsule shows that transactions on the threads are assigned different global ids:

      TxCapsule: Reused instance for tx=XidImpl [FormatId=257, GlobalId=bdobby//78, BranchQual=] (Global id is different on each thread)

      but datasource logging appears to show that the same connection is handed out in each thread, enlisted in the same tx:

      Resource 'com.jnetdirect.jsql.JSQLXAResource@fa09bd' enlisted or 'com.jnetdirect.jsql.JSQLXAConnection@fa0fa3'.
      Pool Nobilis [1/2/Unlimited] gave out pooled object: com.jnetdirect.jsql.JSQLXAConnection@fa0fa3
      Pool Nobilis [0/2/Unlimited] returned object com.jnetdirect.jsql.JSQLXAConnection@fa0fa3 to the pool.

      (these ids are the same on each thread).

      Our EJBs hold a connection for the shortest possible time, usually one statement execution, though they may execute several statements during a method call (either directly or by calling entity beans or CMT session beans).

      Surely the connection pool should ensure that a connection enlisted in a transaction is only handed out to the thread that started the transaction?

      Has anyone seen this behaviour, or have any idea what we may be doing wrong?