User: fleury
Date: 00/08/28 10:46:23
Modified: src/main/org/jboss/tm TxManager.java
Log:
We dis-associate the thread on commit and rollback (as it should be).
Revision Changes Path
1.11 +42 -32 jboss/src/main/org/jboss/tm/TxManager.java
Index: TxManager.java
===================================================================
RCS file: /products/cvs/ejboss/jboss/src/main/org/jboss/tm/TxManager.java,v
retrieving revision 1.10
retrieving revision 1.11
diff -u -r1.10 -r1.11
--- TxManager.java 2000/08/18 03:21:12 1.10
+++ TxManager.java 2000/08/28 17:46:22 1.11
@@ -31,7 +31,7 @@
* @see <related>
* @author Rickard �berg ([EMAIL PROTECTED])
* @author <a href="mailto:[EMAIL PROTECTED]">Marc Fleury</a>
- * @version $Revision: 1.10 $
+ * @version $Revision: 1.11 $
*/
public class TxManager
implements TransactionManager
@@ -76,15 +76,9 @@
{
// Logger.log("commit tx");
- try {
+
getTransaction().commit();
- }
- finally {
-
- // Disassociation
- threadTx.set(null);
- }
}
public int getStatus()
@@ -205,33 +199,41 @@
- // Public --------------------------------------------------------
- public void commit(Transaction tx)
- throws RollbackException,
- HeuristicMixedException,
- HeuristicRollbackException,
- java.lang.SecurityException,
- java.lang.IllegalStateException,
- SystemException
- {
- // Look up the txCapsule and delegate
- ((TxCapsule) txCapsules.get(tx)).commit();
- }
-
- public boolean delistResource(Transaction tx, XAResource xaRes, int flag)
+ // Public --------------------------------------------------------
+ protected void commit(Transaction tx)
+ throws RollbackException,
+ HeuristicMixedException,
+ HeuristicRollbackException,
+ java.lang.SecurityException,
+ java.lang.IllegalStateException,
+ SystemException
+ {
+ try {
+
+ // Look up the txCapsule and delegate
+ ((TxCapsule) txCapsules.get(tx)).commit();
+ }
+ finally {
+
+ // Disassociation
+ threadTx.set(null);
+ }
+ }
+
+ protected boolean delistResource(Transaction tx, XAResource xaRes, int flag)
{
// Look up the txCapsule and delegate
return ((TxCapsule) txCapsules.get(tx)).delistResource(xaRes, flag);
}
- public boolean enlistResource(Transaction tx, XAResource xaRes)
+ protected boolean enlistResource(Transaction tx, XAResource xaRes)
throws RollbackException
{
// Look up the txCapsule and delegate
return ((TxCapsule) txCapsules.get(tx)).enlistResource(xaRes);
}
- public int getStatus(Transaction tx)
+ protected int getStatus(Transaction tx)
throws SystemException
{
// Look up the txCapsule and delegate
@@ -239,22 +241,30 @@
return txCap == null ? Status.STATUS_NO_TRANSACTION : txCap.getStatus();
}
- public void registerSynchronization(Transaction tx, Synchronization s)
+ protected void registerSynchronization(Transaction tx, Synchronization s)
{
// Look up the txCapsule and delegate
((TxCapsule) txCapsules.get(tx)).registerSynchronization(s);
}
- public void rollback(Transaction tx)
+ protected void rollback(Transaction tx)
throws java.lang.IllegalStateException,
java.lang.SecurityException,
SystemException
- {
- // Look up the txCapsule and delegate
- ((TxCapsule) txCapsules.get(tx)).rollback();
- }
-
- public void setRollbackOnly(Transaction tx)
+ {
+ try {
+
+ // Look up the txCapsule and delegate
+ ((TxCapsule) txCapsules.get(tx)).rollback();
+ }
+ finally {
+
+ // Disassociation
+ threadTx.set(null);
+ }
+ }
+
+ protected void setRollbackOnly(Transaction tx)
throws java.lang.IllegalStateException,
SystemException
{