geronimo-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Lin Sun (JIRA)" <j...@apache.org>
Subject [jira] Resolved: (GERONIMO-4448) TransactionManager resume method should only resume valid transaction
Date Wed, 10 Dec 2008 20:40:44 GMT

     [ 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.


Mime
View raw message