You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@geronimo.apache.org by "Lin Sun (JIRA)" <ji...@apache.org> on 2008/12/04 16:14:44 UTC

[jira] Created: (GERONIMO-4448) TransactionManager resume method should only resume previously suspended transaction

TransactionManager resume method should only resume previously suspended transaction
------------------------------------------------------------------------------------

                 Key: GERONIMO-4448
                 URL: https://issues.apache.org/jira/browse/GERONIMO-4448
             Project: Geronimo
          Issue Type: Bug
      Security Level: public (Regular issues)
          Components: transaction manager
    Affects Versions: 2.2
            Reporter: Lin Sun
            Assignee: Lin Sun
             Fix For: 2.2


Currently, the resume manager resumes pretty much any transaction as long as the transaction is not null and is an instance of TransactionImpl.

I think this is incorrect.  Per the jTA 1.1 spec, page 13:

Suspending and Resuming a Transaction 
A call to theTransactionManager.suspend method temporarily suspends the 
transaction that is currently associated with the calling thread. If the thread is not 
associated with any transaction, anull object reference is returned; otherwise, a valid 
Transaction object is returned. TheTransactionobject can later be passed to the 
resume method to reinstate the transaction context association with the calling thread. 
TheTransactionManager.resumemethod re-associates the specified transaction 
context with the calling thread. If the transaction specified is a valid transaction, the
transaction context is associated with the calling thread; otherwise, the thread is 
associated with no transaction. 

Transaction tobj = TransactionManager.suspend(); 
.. 
TransactionManager.resume(tobj); 

A simple test below would reveal the prob:

    public void testResume1() throws Exception {
        Transaction tx;
        assertEquals(Status.STATUS_NO_TRANSACTION, tm.getStatus());
        tm.begin();   
        assertEquals(Status.STATUS_ACTIVE, tm.getStatus());
        tx = tm.getTransaction();
        assertNotNull(tx);
        assertEquals(Status.STATUS_ACTIVE, tx.getStatus());
        
        tm.commit();
        assertEquals(Status.STATUS_NO_TRANSACTION, tm.getStatus());
        assertNull(tm.getTransaction());
        
        try {
        	tm.resume(tx);
        	fail();
        } catch (InvalidTransactionException e) {
        	// expected
        }        
    }

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Updated: (GERONIMO-4448) TransactionManager resume method should only resume valid transaction

Posted by "Lin Sun (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/GERONIMO-4448?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Lin Sun updated GERONIMO-4448:
------------------------------

    Summary: TransactionManager resume method should only resume valid transaction  (was: TransactionManager resume method should only resume previously suspended transaction)

Hi David,

I agree with your most recent comment and the test code, thus I modified the description (as it was worded poorly originally).   Thanks again for your comment here!

Lin

> TransactionManager resume method should only resume valid transaction
> ---------------------------------------------------------------------
>
>                 Key: GERONIMO-4448
>                 URL: https://issues.apache.org/jira/browse/GERONIMO-4448
>             Project: Geronimo
>          Issue Type: Bug
>      Security Level: public(Regular issues) 
>          Components: transaction manager
>    Affects Versions: 2.2
>            Reporter: Lin Sun
>            Assignee: Lin Sun
>             Fix For: 2.2
>
>
> Currently, the resume manager resumes pretty much any transaction as long as the transaction is not null and is an instance of TransactionImpl.
> I think this is incorrect.  Per the jTA 1.1 spec, page 13:
> Suspending and Resuming a Transaction 
> A call to theTransactionManager.suspend method temporarily suspends the 
> transaction that is currently associated with the calling thread. If the thread is not 
> associated with any transaction, anull object reference is returned; otherwise, a valid 
> Transaction object is returned. TheTransactionobject can later be passed to the 
> resume method to reinstate the transaction context association with the calling thread. 
> TheTransactionManager.resumemethod re-associates the specified transaction 
> context with the calling thread. If the transaction specified is a valid transaction, the
> transaction context is associated with the calling thread; otherwise, the thread is 
> associated with no transaction. 
> Transaction tobj = TransactionManager.suspend(); 
> .. 
> TransactionManager.resume(tobj); 
> A simple test below would reveal the prob:
> {code}
>     public void testResume1() throws Exception {
>         Transaction tx;
>         assertEquals(Status.STATUS_NO_TRANSACTION, tm.getStatus());
>         tm.begin();   
>         assertEquals(Status.STATUS_ACTIVE, tm.getStatus());
>         tx = tm.getTransaction();
>         assertNotNull(tx);
>         assertEquals(Status.STATUS_ACTIVE, tx.getStatus());
>         
>         tm.commit();
>         assertEquals(Status.STATUS_NO_TRANSACTION, tm.getStatus());
>         assertNull(tm.getTransaction());
>         
>         try {
>         	tm.resume(tx);
>         	fail();
>         } catch (InvalidTransactionException e) {
>         	// expected
>         }        
>     }
> {code}

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (GERONIMO-4448) TransactionManager resume method should only resume previously suspended transaction

Posted by "Lin Sun (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/GERONIMO-4448?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12653474#action_12653474 ] 

Lin Sun commented on GERONIMO-4448:
-----------------------------------

Hi David, thanks a bunch for the comment!

If you look at the test case, the test should not fail, because the tx here is an invalid transaction. But when I ran the test with G's txmanager, it would fail because we didn't check if the transaction was from a previously suspended transaction. I agree that the spec didn't mention if it is ok to suspend a transaction that is prepared but not committed or roll back only. For the resume method, the JTA spec says the transaction obj from suspend can be passed into the resume method and gives an example on that. I think I interpreted it as only the previously suspended transaction can be passed into the resume method as valid transaction. Comments?

Lin

> TransactionManager resume method should only resume previously suspended transaction
> ------------------------------------------------------------------------------------
>
>                 Key: GERONIMO-4448
>                 URL: https://issues.apache.org/jira/browse/GERONIMO-4448
>             Project: Geronimo
>          Issue Type: Bug
>      Security Level: public(Regular issues) 
>          Components: transaction manager
>    Affects Versions: 2.2
>            Reporter: Lin Sun
>            Assignee: Lin Sun
>             Fix For: 2.2
>
>
> Currently, the resume manager resumes pretty much any transaction as long as the transaction is not null and is an instance of TransactionImpl.
> I think this is incorrect.  Per the jTA 1.1 spec, page 13:
> Suspending and Resuming a Transaction 
> A call to theTransactionManager.suspend method temporarily suspends the 
> transaction that is currently associated with the calling thread. If the thread is not 
> associated with any transaction, anull object reference is returned; otherwise, a valid 
> Transaction object is returned. TheTransactionobject can later be passed to the 
> resume method to reinstate the transaction context association with the calling thread. 
> TheTransactionManager.resumemethod re-associates the specified transaction 
> context with the calling thread. If the transaction specified is a valid transaction, the
> transaction context is associated with the calling thread; otherwise, the thread is 
> associated with no transaction. 
> Transaction tobj = TransactionManager.suspend(); 
> .. 
> TransactionManager.resume(tobj); 
> A simple test below would reveal the prob:
> {code}
>     public void testResume1() throws Exception {
>         Transaction tx;
>         assertEquals(Status.STATUS_NO_TRANSACTION, tm.getStatus());
>         tm.begin();   
>         assertEquals(Status.STATUS_ACTIVE, tm.getStatus());
>         tx = tm.getTransaction();
>         assertNotNull(tx);
>         assertEquals(Status.STATUS_ACTIVE, tx.getStatus());
>         
>         tm.commit();
>         assertEquals(Status.STATUS_NO_TRANSACTION, tm.getStatus());
>         assertNull(tm.getTransaction());
>         
>         try {
>         	tm.resume(tx);
>         	fail();
>         } catch (InvalidTransactionException e) {
>         	// expected
>         }        
>     }
> {code}

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Updated: (GERONIMO-4448) TransactionManager resume method should only resume valid transaction

Posted by "Lin Sun (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/GERONIMO-4448?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Lin Sun updated GERONIMO-4448:
------------------------------

    Affects Version/s: 2.1.4
        Fix Version/s: 2.1.4

> TransactionManager resume method should only resume valid transaction
> ---------------------------------------------------------------------
>
>                 Key: GERONIMO-4448
>                 URL: https://issues.apache.org/jira/browse/GERONIMO-4448
>             Project: Geronimo
>          Issue Type: Bug
>      Security Level: public(Regular issues) 
>          Components: transaction manager
>    Affects Versions: 2.1.4, 2.2
>            Reporter: Lin Sun
>            Assignee: Lin Sun
>             Fix For: 2.1.4, 2.2
>
>
> Currently, the resume manager resumes pretty much any transaction as long as the transaction is not null and is an instance of TransactionImpl.
> I think this is incorrect.  Per the jTA 1.1 spec, page 13:
> Suspending and Resuming a Transaction 
> A call to theTransactionManager.suspend method temporarily suspends the 
> transaction that is currently associated with the calling thread. If the thread is not 
> associated with any transaction, anull object reference is returned; otherwise, a valid 
> Transaction object is returned. TheTransactionobject can later be passed to the 
> resume method to reinstate the transaction context association with the calling thread. 
> TheTransactionManager.resumemethod re-associates the specified transaction 
> context with the calling thread. If the transaction specified is a valid transaction, the
> transaction context is associated with the calling thread; otherwise, the thread is 
> associated with no transaction. 
> Transaction tobj = TransactionManager.suspend(); 
> .. 
> TransactionManager.resume(tobj); 
> A simple test below would reveal the prob:
> {code}
>     public void testResume1() throws Exception {
>         Transaction tx;
>         assertEquals(Status.STATUS_NO_TRANSACTION, tm.getStatus());
>         tm.begin();   
>         assertEquals(Status.STATUS_ACTIVE, tm.getStatus());
>         tx = tm.getTransaction();
>         assertNotNull(tx);
>         assertEquals(Status.STATUS_ACTIVE, tx.getStatus());
>         
>         tm.commit();
>         assertEquals(Status.STATUS_NO_TRANSACTION, tm.getStatus());
>         assertNull(tm.getTransaction());
>         
>         try {
>         	tm.resume(tx);
>         	fail();
>         } catch (InvalidTransactionException e) {
>         	// expected
>         }        
>     }
> {code}

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (GERONIMO-4448) TransactionManager resume method should only resume previously suspended transaction

Posted by "David Jencks (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/GERONIMO-4448?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12653460#action_12653460 ] 

David Jencks commented on GERONIMO-4448:
----------------------------------------

I'm not sure exactly what you see as the problem here....  IMO the behavior when "resuming" a non-suspended transaction is not specified so we don't need to check that the argument to resume is in fact suspended.

However..., what is a valid transaction?  Does the jta spec define this anywhere?

For instance.... can you suspend a transaction that is prepared but not committed?  How about if you've called setRollbackOnly() on it?

IIRC (from many years ago) the jta spec tends to not specify a lot of this behavior.

> TransactionManager resume method should only resume previously suspended transaction
> ------------------------------------------------------------------------------------
>
>                 Key: GERONIMO-4448
>                 URL: https://issues.apache.org/jira/browse/GERONIMO-4448
>             Project: Geronimo
>          Issue Type: Bug
>      Security Level: public(Regular issues) 
>          Components: transaction manager
>    Affects Versions: 2.2
>            Reporter: Lin Sun
>            Assignee: Lin Sun
>             Fix For: 2.2
>
>
> Currently, the resume manager resumes pretty much any transaction as long as the transaction is not null and is an instance of TransactionImpl.
> I think this is incorrect.  Per the jTA 1.1 spec, page 13:
> Suspending and Resuming a Transaction 
> A call to theTransactionManager.suspend method temporarily suspends the 
> transaction that is currently associated with the calling thread. If the thread is not 
> associated with any transaction, anull object reference is returned; otherwise, a valid 
> Transaction object is returned. TheTransactionobject can later be passed to the 
> resume method to reinstate the transaction context association with the calling thread. 
> TheTransactionManager.resumemethod re-associates the specified transaction 
> context with the calling thread. If the transaction specified is a valid transaction, the
> transaction context is associated with the calling thread; otherwise, the thread is 
> associated with no transaction. 
> Transaction tobj = TransactionManager.suspend(); 
> .. 
> TransactionManager.resume(tobj); 
> A simple test below would reveal the prob:
> {code}
>     public void testResume1() throws Exception {
>         Transaction tx;
>         assertEquals(Status.STATUS_NO_TRANSACTION, tm.getStatus());
>         tm.begin();   
>         assertEquals(Status.STATUS_ACTIVE, tm.getStatus());
>         tx = tm.getTransaction();
>         assertNotNull(tx);
>         assertEquals(Status.STATUS_ACTIVE, tx.getStatus());
>         
>         tm.commit();
>         assertEquals(Status.STATUS_NO_TRANSACTION, tm.getStatus());
>         assertNull(tm.getTransaction());
>         
>         try {
>         	tm.resume(tx);
>         	fail();
>         } catch (InvalidTransactionException e) {
>         	// expected
>         }        
>     }
> {code}

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (GERONIMO-4448) TransactionManager resume method should only resume previously suspended transaction

Posted by "David Jencks (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/GERONIMO-4448?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12654888#action_12654888 ] 

David Jencks commented on GERONIMO-4448:
----------------------------------------

I think I might have not looked at your test hard enough.  I think I must have missed the "tm.commit()"

There are a few questions here...
- what is a valid non-null transaction.  After some hints from others I think the answer is a tx that has not had (directly or through the tm) commit() or rollback() called on it.
- is null a valid transaction. For ease of use I think the answer is "yes"
- does the argument to resume need to be obtained from suspend.  I think "no".

So... I think the following ought to pass:

-- your original test

------
// null is a valid tx
//tm.commit(); just make sure there's no tx
tm.suspend();//will return null
tm.begin();
tm.commit();
tm.resume(null)


-------
//resume works on any valid tx,
tm.begin();
tx = tm.getTransaction();
tm.resume(tx);

-----
//commit/rollback invalidates a tx no matter how tx is committed (directly or through tm)
tm.begin();
tx = tm.getTransaction();
tm.suspend();
tx.commit(); //or rollback
try {
  tm.resume(tx);
  fail();
} catch (InvalidTransactionException e) {
  //expected
}

Hopefully I haven't overlooked any other obvious points.

> TransactionManager resume method should only resume previously suspended transaction
> ------------------------------------------------------------------------------------
>
>                 Key: GERONIMO-4448
>                 URL: https://issues.apache.org/jira/browse/GERONIMO-4448
>             Project: Geronimo
>          Issue Type: Bug
>      Security Level: public(Regular issues) 
>          Components: transaction manager
>    Affects Versions: 2.2
>            Reporter: Lin Sun
>            Assignee: Lin Sun
>             Fix For: 2.2
>
>
> Currently, the resume manager resumes pretty much any transaction as long as the transaction is not null and is an instance of TransactionImpl.
> I think this is incorrect.  Per the jTA 1.1 spec, page 13:
> Suspending and Resuming a Transaction 
> A call to theTransactionManager.suspend method temporarily suspends the 
> transaction that is currently associated with the calling thread. If the thread is not 
> associated with any transaction, anull object reference is returned; otherwise, a valid 
> Transaction object is returned. TheTransactionobject can later be passed to the 
> resume method to reinstate the transaction context association with the calling thread. 
> TheTransactionManager.resumemethod re-associates the specified transaction 
> context with the calling thread. If the transaction specified is a valid transaction, the
> transaction context is associated with the calling thread; otherwise, the thread is 
> associated with no transaction. 
> Transaction tobj = TransactionManager.suspend(); 
> .. 
> TransactionManager.resume(tobj); 
> A simple test below would reveal the prob:
> {code}
>     public void testResume1() throws Exception {
>         Transaction tx;
>         assertEquals(Status.STATUS_NO_TRANSACTION, tm.getStatus());
>         tm.begin();   
>         assertEquals(Status.STATUS_ACTIVE, tm.getStatus());
>         tx = tm.getTransaction();
>         assertNotNull(tx);
>         assertEquals(Status.STATUS_ACTIVE, tx.getStatus());
>         
>         tm.commit();
>         assertEquals(Status.STATUS_NO_TRANSACTION, tm.getStatus());
>         assertNull(tm.getTransaction());
>         
>         try {
>         	tm.resume(tx);
>         	fail();
>         } catch (InvalidTransactionException e) {
>         	// expected
>         }        
>     }
> {code}

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Updated: (GERONIMO-4448) TransactionManager resume method should only resume previously suspended transaction

Posted by "Lin Sun (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/GERONIMO-4448?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Lin Sun updated GERONIMO-4448:
------------------------------

    Description: 
Currently, the resume manager resumes pretty much any transaction as long as the transaction is not null and is an instance of TransactionImpl.

I think this is incorrect.  Per the jTA 1.1 spec, page 13:

Suspending and Resuming a Transaction 
A call to theTransactionManager.suspend method temporarily suspends the 
transaction that is currently associated with the calling thread. If the thread is not 
associated with any transaction, anull object reference is returned; otherwise, a valid 
Transaction object is returned. TheTransactionobject can later be passed to the 
resume method to reinstate the transaction context association with the calling thread. 
TheTransactionManager.resumemethod re-associates the specified transaction 
context with the calling thread. If the transaction specified is a valid transaction, the
transaction context is associated with the calling thread; otherwise, the thread is 
associated with no transaction. 

Transaction tobj = TransactionManager.suspend(); 
.. 
TransactionManager.resume(tobj); 

A simple test below would reveal the prob:

{code}
    public void testResume1() throws Exception {
        Transaction tx;
        assertEquals(Status.STATUS_NO_TRANSACTION, tm.getStatus());
        tm.begin();   
        assertEquals(Status.STATUS_ACTIVE, tm.getStatus());
        tx = tm.getTransaction();
        assertNotNull(tx);
        assertEquals(Status.STATUS_ACTIVE, tx.getStatus());
        
        tm.commit();
        assertEquals(Status.STATUS_NO_TRANSACTION, tm.getStatus());
        assertNull(tm.getTransaction());
        
        try {
        	tm.resume(tx);
        	fail();
        } catch (InvalidTransactionException e) {
        	// expected
        }        
    }

{code}

  was:
Currently, the resume manager resumes pretty much any transaction as long as the transaction is not null and is an instance of TransactionImpl.

I think this is incorrect.  Per the jTA 1.1 spec, page 13:

Suspending and Resuming a Transaction 
A call to theTransactionManager.suspend method temporarily suspends the 
transaction that is currently associated with the calling thread. If the thread is not 
associated with any transaction, anull object reference is returned; otherwise, a valid 
Transaction object is returned. TheTransactionobject can later be passed to the 
resume method to reinstate the transaction context association with the calling thread. 
TheTransactionManager.resumemethod re-associates the specified transaction 
context with the calling thread. If the transaction specified is a valid transaction, the
transaction context is associated with the calling thread; otherwise, the thread is 
associated with no transaction. 

Transaction tobj = TransactionManager.suspend(); 
.. 
TransactionManager.resume(tobj); 

A simple test below would reveal the prob:

    public void testResume1() throws Exception {
        Transaction tx;
        assertEquals(Status.STATUS_NO_TRANSACTION, tm.getStatus());
        tm.begin();   
        assertEquals(Status.STATUS_ACTIVE, tm.getStatus());
        tx = tm.getTransaction();
        assertNotNull(tx);
        assertEquals(Status.STATUS_ACTIVE, tx.getStatus());
        
        tm.commit();
        assertEquals(Status.STATUS_NO_TRANSACTION, tm.getStatus());
        assertNull(tm.getTransaction());
        
        try {
        	tm.resume(tx);
        	fail();
        } catch (InvalidTransactionException e) {
        	// expected
        }        
    }


> TransactionManager resume method should only resume previously suspended transaction
> ------------------------------------------------------------------------------------
>
>                 Key: GERONIMO-4448
>                 URL: https://issues.apache.org/jira/browse/GERONIMO-4448
>             Project: Geronimo
>          Issue Type: Bug
>      Security Level: public(Regular issues) 
>          Components: transaction manager
>    Affects Versions: 2.2
>            Reporter: Lin Sun
>            Assignee: Lin Sun
>             Fix For: 2.2
>
>
> Currently, the resume manager resumes pretty much any transaction as long as the transaction is not null and is an instance of TransactionImpl.
> I think this is incorrect.  Per the jTA 1.1 spec, page 13:
> Suspending and Resuming a Transaction 
> A call to theTransactionManager.suspend method temporarily suspends the 
> transaction that is currently associated with the calling thread. If the thread is not 
> associated with any transaction, anull object reference is returned; otherwise, a valid 
> Transaction object is returned. TheTransactionobject can later be passed to the 
> resume method to reinstate the transaction context association with the calling thread. 
> TheTransactionManager.resumemethod re-associates the specified transaction 
> context with the calling thread. If the transaction specified is a valid transaction, the
> transaction context is associated with the calling thread; otherwise, the thread is 
> associated with no transaction. 
> Transaction tobj = TransactionManager.suspend(); 
> .. 
> TransactionManager.resume(tobj); 
> A simple test below would reveal the prob:
> {code}
>     public void testResume1() throws Exception {
>         Transaction tx;
>         assertEquals(Status.STATUS_NO_TRANSACTION, tm.getStatus());
>         tm.begin();   
>         assertEquals(Status.STATUS_ACTIVE, tm.getStatus());
>         tx = tm.getTransaction();
>         assertNotNull(tx);
>         assertEquals(Status.STATUS_ACTIVE, tx.getStatus());
>         
>         tm.commit();
>         assertEquals(Status.STATUS_NO_TRANSACTION, tm.getStatus());
>         assertNull(tm.getTransaction());
>         
>         try {
>         	tm.resume(tx);
>         	fail();
>         } catch (InvalidTransactionException e) {
>         	// expected
>         }        
>     }
> {code}

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Resolved: (GERONIMO-4448) TransactionManager resume method should only resume valid transaction

Posted by "Lin Sun (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/GERONIMO-4448?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Lin Sun resolved GERONIMO-4448.
-------------------------------

    Resolution: Fixed

Fixed in txmanager 2.1.2 + 2.2.  (see subversion commit).  Added 4 resume test to document suggested test cases from this JIRA and all tests pass now.

> TransactionManager resume method should only resume valid transaction
> ---------------------------------------------------------------------
>
>                 Key: GERONIMO-4448
>                 URL: https://issues.apache.org/jira/browse/GERONIMO-4448
>             Project: Geronimo
>          Issue Type: Bug
>      Security Level: public(Regular issues) 
>          Components: transaction manager
>    Affects Versions: 2.2
>            Reporter: Lin Sun
>            Assignee: Lin Sun
>             Fix For: 2.2
>
>
> Currently, the resume manager resumes pretty much any transaction as long as the transaction is not null and is an instance of TransactionImpl.
> I think this is incorrect.  Per the jTA 1.1 spec, page 13:
> Suspending and Resuming a Transaction 
> A call to theTransactionManager.suspend method temporarily suspends the 
> transaction that is currently associated with the calling thread. If the thread is not 
> associated with any transaction, anull object reference is returned; otherwise, a valid 
> Transaction object is returned. TheTransactionobject can later be passed to the 
> resume method to reinstate the transaction context association with the calling thread. 
> TheTransactionManager.resumemethod re-associates the specified transaction 
> context with the calling thread. If the transaction specified is a valid transaction, the
> transaction context is associated with the calling thread; otherwise, the thread is 
> associated with no transaction. 
> Transaction tobj = TransactionManager.suspend(); 
> .. 
> TransactionManager.resume(tobj); 
> A simple test below would reveal the prob:
> {code}
>     public void testResume1() throws Exception {
>         Transaction tx;
>         assertEquals(Status.STATUS_NO_TRANSACTION, tm.getStatus());
>         tm.begin();   
>         assertEquals(Status.STATUS_ACTIVE, tm.getStatus());
>         tx = tm.getTransaction();
>         assertNotNull(tx);
>         assertEquals(Status.STATUS_ACTIVE, tx.getStatus());
>         
>         tm.commit();
>         assertEquals(Status.STATUS_NO_TRANSACTION, tm.getStatus());
>         assertNull(tm.getTransaction());
>         
>         try {
>         	tm.resume(tx);
>         	fail();
>         } catch (InvalidTransactionException e) {
>         	// expected
>         }        
>     }
> {code}

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.