[jboss-cvs] JBossCache/src/org/jboss/cache/interceptors ...
Manik Surtani
msurtani at jboss.com
Thu Oct 19 09:29:57 EDT 2006
User: msurtani
Date: 06/10/19 09:29:57
Modified: src/org/jboss/cache/interceptors TxInterceptor.java
Log:
JBCACHE-790
Revision Changes Path
1.62 +22 -2 JBossCache/src/org/jboss/cache/interceptors/TxInterceptor.java
(In the diff below, changes in quantity of whitespace are not shown.)
Index: TxInterceptor.java
===================================================================
RCS file: /cvsroot/jboss/JBossCache/src/org/jboss/cache/interceptors/TxInterceptor.java,v
retrieving revision 1.61
retrieving revision 1.62
diff -u -b -r1.61 -r1.62
--- TxInterceptor.java 25 Sep 2006 05:50:04 -0000 1.61
+++ TxInterceptor.java 19 Oct 2006 13:29:57 -0000 1.62
@@ -276,6 +276,8 @@
}
if (tx != null) m = attachGlobalTransaction(tx, m);
+ GlobalTransaction gtx = ctx.getGlobalTransaction();
+
try
{
result = super.invoke(m);
@@ -293,6 +295,7 @@
result = t;
try
{
+ setTransactionalContext(tx, gtx);
txManager.rollback();
}
catch (Throwable th)
@@ -398,7 +401,7 @@
success = false;
if (retval instanceof Exception)
{
- throw (Exception) retval;
+ throw(Exception) retval;
}
}
}
@@ -873,6 +876,7 @@
// ------------------------------------------------------------------------
// this controls the whole transaction
+
class RemoteSynchronizationHandler implements Synchronization
{
Transaction tx = null;
@@ -910,6 +914,22 @@
try
{
setTransactionalContext(tx, gtx);
+
+ if (status == Status.STATUS_ROLLEDBACK || status == Status.STATUS_ROLLING_BACK)
+ {
+ System.out.println("ROLLING BACK WITH TX " + tx + " and GTX " + gtx);
+ }
+
+ try
+ {
+ if (txManager.getTransaction() != null && !txManager.getTransaction().equals(tx)) txManager.resume(tx);
+ }
+ catch (Exception e)
+ {
+ System.out.println("CAUGHT EXCEPTION: ");
+ e.printStackTrace();
+ }
+
if (log.isTraceEnabled()) log.trace("calling aftercompletion for " + gtx);
// set any transaction wide options as current for this thread.
if ((entry = txTable.get(gtx)) != null)
@@ -993,7 +1013,7 @@
if (result instanceof Throwable)
{
tx.setRollbackOnly();
- throw (Throwable) result;
+ throw(Throwable) result;
}
break;
default:
More information about the jboss-cvs-commits
mailing list