git-svn-id: http://code.alibabatech.com/svn/druid/trunk@28 b9813039-fb51-4c41-a8b9-e21c2acb5095
This commit is contained in:
wenshao
2011-05-12 06:05:34 +00:00
parent 6df45cd1d7
commit df3e5f7724
2 changed files with 4 additions and 4 deletions
@@ -21,7 +21,7 @@ import java.lang.ref.WeakReference;
*/
public class TransactionContext {
private final TransactionRegistry transactionRegistry;
private final WeakReference transactionRef;
private final WeakReference<Transaction> transactionRef;
private Connection sharedConnection;
/**
@@ -37,7 +37,7 @@ public class TransactionContext {
if (transactionRegistry == null) throw new NullPointerException("transactionRegistry is null");
if (transaction == null) throw new NullPointerException("transaction is null");
this.transactionRegistry = transactionRegistry;
this.transactionRef = new WeakReference(transaction);
this.transactionRef = new WeakReference<Transaction>(transaction);
}
/**
@@ -23,8 +23,8 @@ import javax.transaction.xa.XAResource;
*/
public class TransactionRegistry {
private final TransactionManager transactionManager;
private final Map caches = new WeakHashMap();
private final Map xaResources = new WeakHashMap();
private final Map<Transaction, TransactionContext> caches = new WeakHashMap<Transaction, TransactionContext>();
private final Map<Connection, XAResource> xaResources = new WeakHashMap<Connection, XAResource>();
/**
* Creates a TransactionRegistry for the specified transaction manager.