Return-Path: Delivered-To: apmail-geronimo-dev-archive@www.apache.org Received: (qmail 71285 invoked from network); 4 Dec 2008 15:17:37 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 4 Dec 2008 15:17:37 -0000 Received: (qmail 11506 invoked by uid 500); 4 Dec 2008 15:17:47 -0000 Delivered-To: apmail-geronimo-dev-archive@geronimo.apache.org Received: (qmail 11455 invoked by uid 500); 4 Dec 2008 15:17:47 -0000 Mailing-List: contact dev-help@geronimo.apache.org; run by ezmlm Precedence: bulk list-help: list-unsubscribe: List-Post: Reply-To: dev@geronimo.apache.org List-Id: Delivered-To: mailing list dev@geronimo.apache.org Received: (qmail 11443 invoked by uid 99); 4 Dec 2008 15:17:47 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 04 Dec 2008 07:17:47 -0800 X-ASF-Spam-Status: No, hits=-2000.0 required=10.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [140.211.11.140] (HELO brutus.apache.org) (140.211.11.140) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 04 Dec 2008 15:16:26 +0000 Received: from brutus (localhost [127.0.0.1]) by brutus.apache.org (Postfix) with ESMTP id 827B4234C2D9 for ; Thu, 4 Dec 2008 07:16:44 -0800 (PST) Message-ID: <1805279833.1228403804515.JavaMail.jira@brutus> Date: Thu, 4 Dec 2008 07:16:44 -0800 (PST) From: "Lin Sun (JIRA)" To: dev@geronimo.apache.org Subject: [jira] Updated: (GERONIMO-4448) TransactionManager resume method should only resume previously suspended transaction In-Reply-To: <290543106.1228403684396.JavaMail.jira@brutus> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-Virus-Checked: Checked by ClamAV on 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.