Bugs item #731349, was opened at 2003-05-02 13:50
Message generated for change (Settings changed) made by ejort
You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=376685&aid=731349&group_id=22866

Category: JBossCX
Group: v3.2
>Status: Closed
Resolution: Accepted
Priority: 7
Submitted By: Mark Little (marklittle)
Assigned to: Adrian Brock (ejort)
Summary: Transaction active test

Initial Comment:
A thread may terminate a transaction via the 
Transaction instance, but if it does the thread-to-
transaction association shouldn't be affected. What this 
means is that a thread could then have a non-active 
transaction associated with it.

There are some places in the  
org.jboss.resource.connectionmanager.TxConnectionMa
nager class where the presence of a Transaction on the 
thread is assumed to mean that the transaction is 
active:

public void localTransactionStarted(ConnectionEvent ce)
      {
         if (currentTx != null) 
         {
            throw new IllegalStateException("Attempt to 
start local transaction while xa transaction is active!");
         } // end of if ()
         
      }

Unfortunately non-null doesn't mean active.

Mark.


----------------------------------------------------------------------

Comment By: David Jencks (d_jencks)
Date: 2003-05-11 03:04

Message:
Logged In: YES 
user_id=60525

I believe I have fixed this and all related problems in jboss 4.  I'm attaching a 
diff of the jb4 changes for comparison with Mark's proposed future diff for 
3.2.  Many thanks to Mark for pointing out these problems.

----------------------------------------------------------------------

Comment By: Mark Little (marklittle)
Date: 2003-05-06 09:21

Message:
Logged In: YES 
user_id=754951

Sorry, maybe there's been a misunderstanding (and my 
snippet of code was probably to blame). The real issue is to 
do with obtaining the transaction via getTransaction and just 
assuming because it is non-null that it implies an active 
transaction: it doesn't. So,

if (tm.getStatus() != Status.STATUS_NO_TRANSACTION)
         {
            Transaction newCurrentTx = tm.getTransaction();
            //check to see if it is still the original tx.
            //currentTx can only be non-null if we are tracking cx 
by tx.
            if (currentTx != null && currentTx != newCurrentTx) 
            {

is an invalid test.

Mark.

----------------------------------------------------------------------

Comment By: David Jencks (d_jencks)
Date: 2003-05-02 17:19

Message:
Logged In: YES 
user_id=60525

In TxConnectionManager.TxConnectionListener, currentTx is not necessarily 
the same as the thread's tx association.  In particular, currentTx will be set 
to null either on delist or in a synchronization's afterCompletion method. I 
can't see any circumstance in which you could legally start a local transaction 
and currentTx would be non null. If you can, please explain in more detail.

There may well be other places where we assume a tx on a thread means it 
is active, but I don't think this is one.

----------------------------------------------------------------------

You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=376685&aid=731349&group_id=22866


-------------------------------------------------------
This SF.Net email sponsored by: Free pre-built ASP.NET sites including
Data Reports, E-commerce, Portals, and Forums are available now.
Download today and enter to win an XBOX or Visual Studio .NET.
http://aspnet.click-url.com/go/psa00100006ave/direct;at.asp_061203_01/01
_______________________________________________
Jboss-development mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/jboss-development

Reply via email to