Details
-
Bug
-
Resolution: Done
-
Major
-
JBossAS-5.0.0.CR1, JBossAS-4.2.3.GA
-
None
Description
The ClientUserTransaction singleton initialistation is not thread safe:
private static ClientUserTransaction singleton = null;
public static ClientUserTransaction getSingleton()
{
if (singleton == null)
singleton = new ClientUserTransaction();
return singleton;
}
Two threads can race to create the singleton which means the ThreadLocal within the class can become
"masked".
The construction of the singleton needs moving to static initialisation.
Attachments
Issue Links
- is incorporated by
-
JBPAPP-1157 JBAS-5904 - ClientUserTransaction singleton initialisation is not thread safe
- Resolved