The following comment has been added to this issue:
Author: David Jencks
Created: Tue, 5 Oct 2004 12:08 AM
Body:
After further consideration I concluded that it was not desirable to associate
an UnspecifiedTransactionContext in the connector framework since there is no
way to tell when it may be committed or when the thread association is over.
However I've fixed the NPE's caused by calling into the connector framework
with no tx context.
The only remaining uses of the static TransactionContext methods are in sfsb
method objects. I believe this functionality could be better placed in an
interceptor.
---------------------------------------------------------------------
View this comment:
http://issues.apache.org/jira/browse/GERONIMO-347?page=comments#action_53703
---------------------------------------------------------------------
View the issue:
http://issues.apache.org/jira/browse/GERONIMO-347
Here is an overview of the issue:
---------------------------------------------------------------------
Key: GERONIMO-347
Summary: TransactionContext usage is confused and confusing
Type: Improvement
Status: Open
Priority: Major
Project: Apache Geronimo
Components:
general
Versions:
1.0-M3
Assignee: David Jencks
Reporter: David Jencks
Created: Sat, 2 Oct 2004 10:41 AM
Updated: Tue, 5 Oct 2004 12:08 AM
Description:
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.
---------------------------------------------------------------------
JIRA INFORMATION:
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