Author: manik.surtani(a)jboss.com
Date: 2008-04-24 08:20:44 -0400 (Thu, 24 Apr 2008)
New Revision: 5661
Modified:
core/trunk/src/main/java/org/jboss/cache/interceptors/TxInterceptor.java
core/trunk/src/test/java/org/jboss/cache/replicated/SyncReplTxTest.java
Log:
Fixed proper cleanup after a rollback
Modified: core/trunk/src/main/java/org/jboss/cache/interceptors/TxInterceptor.java
===================================================================
--- core/trunk/src/main/java/org/jboss/cache/interceptors/TxInterceptor.java 2008-04-24
12:05:19 UTC (rev 5660)
+++ core/trunk/src/main/java/org/jboss/cache/interceptors/TxInterceptor.java 2008-04-24
12:20:44 UTC (rev 5661)
@@ -215,6 +215,9 @@
if (ltx == null)
{
log.warn("No local transaction for this remotely originating rollback.
Possibly rolling back before a prepare call was broadcast?");
+ txTable.remove(gtx);
+ scrubOnExist(ctx, true);
+ return null;
}
// disconnect if we have a current tx associated
Transaction currentTx = txManager.getTransaction();
@@ -251,7 +254,6 @@
}
catch (Throwable throwable)
{
- boolean result;
ctx.throwIfNeeded(throwable);
}
finally
Modified: core/trunk/src/test/java/org/jboss/cache/replicated/SyncReplTxTest.java
===================================================================
--- core/trunk/src/test/java/org/jboss/cache/replicated/SyncReplTxTest.java 2008-04-24
12:05:19 UTC (rev 5660)
+++ core/trunk/src/test/java/org/jboss/cache/replicated/SyncReplTxTest.java 2008-04-24
12:20:44 UTC (rev 5661)
@@ -334,8 +334,8 @@
public void testSyncReplWithModficationsOnBothCachesWithRollback() throws Exception
{
TransactionManager tm;
- final Fqn NODE1 = Fqn.fromString("/one/two/three");
- final Fqn NODE2 = Fqn.fromString("/eins/zwei/drei");
+ final Fqn fqn1 = Fqn.fromString("/one/two/three");
+ final Fqn fqn2 = Fqn.fromString("/eins/zwei/drei");
initCaches(Configuration.CacheMode.REPL_SYNC);
@@ -343,8 +343,8 @@
cache2.getConfiguration().setSyncRollbackPhase(true);
tm = beginTransaction();
- cache1.put(NODE1, "age", 38);
- cache2.put(NODE2, "age", 39);
+ cache1.put(fqn1, "age", 38);
+ cache2.put(fqn2, "age", 39);
System.out.println("cache1 (before commit):\n" +
CachePrinter.printCacheLockingInfo(cache1));
System.out.println("cache2 (before commit):\n" +
CachePrinter.printCacheLockingInfo(cache2));