From dev-return-11792-apmail-geronimo-dev-archive=geronimo.apache.org@geronimo.apache.org Sun Mar 06 03:09:05 2005 Return-Path: Delivered-To: apmail-geronimo-dev-archive@www.apache.org Received: (qmail 7606 invoked from network); 6 Mar 2005 03:09:03 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (209.237.227.199) by minotaur-2.apache.org with SMTP; 6 Mar 2005 03:09:03 -0000 Received: (qmail 14363 invoked by uid 500); 6 Mar 2005 03:08:59 -0000 Delivered-To: apmail-geronimo-dev-archive@geronimo.apache.org Received: (qmail 14318 invoked by uid 500); 6 Mar 2005 03:08:59 -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 Delivered-To: mailing list dev@geronimo.apache.org Received: (qmail 14302 invoked by uid 99); 6 Mar 2005 03:08:59 -0000 X-ASF-Spam-Status: No, hits=0.0 required=10.0 tests= X-Spam-Check-By: apache.org Received: from ajax-1.apache.org (HELO ajax.apache.org) (192.87.106.226) by apache.org (qpsmtpd/0.28) with ESMTP; Sat, 05 Mar 2005 19:08:56 -0800 Received: from ajax.apache.org (ajax.apache.org [127.0.0.1]) by ajax.apache.org (8.12.11/8.12.11) with ESMTP id j2638rqx016165 for ; Sun, 6 Mar 2005 04:08:53 +0100 Message-ID: <1315436878.1110078533561.JavaMail.jira@ajax.apache.org> Date: Sun, 6 Mar 2005 04:08:53 +0100 (CET) From: "David Jencks (JIRA)" To: dev@geronimo.apache.org Subject: [jira] Closed: (GERONIMO-347) TransactionContext usage is confused and confusing In-Reply-To: <1453795663.1096738952154.JavaMail.apache@nagoya> Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-Virus-Checked: Checked X-Spam-Rating: minotaur-2.apache.org 1.6.2 0/1000/N [ http://issues.apache.org/jira/browse/GERONIMO-347?page=history ] David Jencks closed GERONIMO-347: --------------------------------- Resolution: Fixed Fix Version: 1.0-M4 Dain recently removed the last uses of TransactionContext static methods outside TransactionContextManager. > TransactionContext usage is confused and confusing > -------------------------------------------------- > > Key: GERONIMO-347 > URL: http://issues.apache.org/jira/browse/GERONIMO-347 > Project: Geronimo > Type: Improvement > Components: transaction manager > Versions: 1.0-M3 > Reporter: David Jencks > Assignee: David Jencks > Fix For: 1.0-M4 > > Currently there is the TransactionContext with static accessors for the current thread's TransactionContext and a TransactionContextManager object/gbean with non-static accessors and helper methods to create the various types of TC and associate them with the current thread. Some components use the TransactionContext static methods and some use the gbean methods. > We have a problem that new threads don't automatically get a TC. For threads we create, we can add code to create the TC, but for threads created e.g. by a servlet we have no direct access to do so. > Our TC cannot safely be shared between threads. Therefore I don't think that using an InheritableThreadLocal in TC is a good solution. > My proposal, which I will implement in the absence of other suggestions, is to eliminate the static methods on TC and just use the gbean accessors. The getTransactionContext method will never return null: if there is no TC for the current thread it will create a new UnspecifiedTransactionContext and associate it with the thread before returning. I may create an additional method for this, getNonNullTransactionContext, so the existing method can be used where it would be an error for no TransactionContext to be associated with the current thread. > The advantage I see in using a gbean rather that static methods is that is will simplify plugging in a different set of TransactionContext implementations should we wish to do so. -- This message is automatically generated by JIRA. - If you think it was sent incorrectly contact one of the administrators: http://issues.apache.org/jira/secure/Administrators.jspa - If you want more information on JIRA, or have a bug to report see: http://www.atlassian.com/software/jira