mirror of
https://github.com/alibaba/druid.git
synced 2023-03-04 19:17:16 +00:00
支持XA
git-svn-id: http://code.alibabatech.com/svn/druid/trunk@28 b9813039-fb51-4c41-a8b9-e21c2acb5095
This commit is contained in:
@@ -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.
|
||||
|
||||
Reference in New Issue
Block a user