Details
-
Type:
Bug
-
Status:
Closed
-
Priority:
Major
-
Resolution: Fixed
-
Affects Version/s: 2.0.0
-
Fix Version/s: 2.0.1
-
Labels:None
-
Number of attachments :
Description
Hi,
I tried to use TransactionSynchronizationRegistry interface (part of JTA 1.1 spec) but got following exception instead:
java.lang.NullPointerException
at bitronix.tm.BitronixTransactionSynchronizationRegistry.getResource(BitronixTransactionSynchronizationRegistry.java:45)
at (...... - not important)
I checked the code and it looks like the ThreadLocal value is not properly initialized for new threads.
Instead of:
private final static ThreadLocal resourcesTl = new ThreadLocal();
public BitronixTransactionSynchronizationRegistry()
{ transactionManager = TransactionManagerServices.getTransactionManager(); resourcesTl.set(new HashMap()); }the code should read:
private final static ThreadLocal resourcesTl = new ThreadLocal() {
protected Object initialValue()
};
public BitronixTransactionSynchronizationRegistry()
{ transactionManager = TransactionManagerServices.getTransactionManager(); }Activity
Ludovic Orban
made changes -
| Field | Original Value | New Value |
|---|---|---|
| Fix Version/s | 2.0.1 [ 16616 ] |
Ludovic Orban
made changes -
| Status | Open [ 1 ] | Resolved [ 5 ] |
| Resolution | Fixed [ 1 ] |
Ludovic Orban
made changes -
| Status | Resolved [ 5 ] | Closed [ 6 ] |
Fixed in trunk; new 2.0.1-SNAPSHOT build has been uploaded so you can easily try it out. See http://docs.codehaus.org/display/BTM/Maven2
Please report back if this new version works for you.