Author: manik.surtani(a)jboss.com
Date: 2008-05-16 09:11:23 -0400 (Fri, 16 May 2008)
New Revision: 5865
Modified:
core/branches/2.1.X/src/main/java/org/jboss/cache/transaction/TransactionEntry.java
core/branches/2.1.X/src/test/java/org/jboss/cache/invocationcontext/TransactionTest.java
core/branches/2.1.X/src/test/java/org/jboss/cache/optimistic/AbstractOptimisticTestCase.java
Log:
JBCACHE-1348: Use of replication queue and transactions may cause modifications not to be
applied on remote nodes
Modified:
core/branches/2.1.X/src/main/java/org/jboss/cache/transaction/TransactionEntry.java
===================================================================
---
core/branches/2.1.X/src/main/java/org/jboss/cache/transaction/TransactionEntry.java 2008-05-16
11:33:45 UTC (rev 5864)
+++
core/branches/2.1.X/src/main/java/org/jboss/cache/transaction/TransactionEntry.java 2008-05-16
13:11:23 UTC (rev 5865)
@@ -132,6 +132,7 @@
public List<MethodCall> getCacheLoaderModifications()
{
// make sure this isn't modified externally
+ if (cl_mod_list == null) return null;
return Collections.unmodifiableList(cl_mod_list);
}
Modified:
core/branches/2.1.X/src/test/java/org/jboss/cache/invocationcontext/TransactionTest.java
===================================================================
---
core/branches/2.1.X/src/test/java/org/jboss/cache/invocationcontext/TransactionTest.java 2008-05-16
11:33:45 UTC (rev 5864)
+++
core/branches/2.1.X/src/test/java/org/jboss/cache/invocationcontext/TransactionTest.java 2008-05-16
13:11:23 UTC (rev 5865)
@@ -137,8 +137,8 @@
assertEquals("MethodCall should have been scrubbed", null,
cache.getInvocationContext().getMethodCall());
// check that the transaction entry hasn't leaked stuff.
- assert entry.getModifications().isEmpty() : "Should have scrubbed
modifications in transaction entry";
- assert entry.getCacheLoaderModifications().isEmpty() : "Should have scrubbed
modifications in transaction entry";
+ assert entry.getModifications() == null : "Should have scrubbed modifications
in transaction entry";
+ assert entry.getCacheLoaderModifications() == null : "Should have scrubbed
modifications in transaction entry";
assert entry.getOrderedSynchronizationHandler() == null : "Should have removed
the ordered sync handler";
}
Modified:
core/branches/2.1.X/src/test/java/org/jboss/cache/optimistic/AbstractOptimisticTestCase.java
===================================================================
---
core/branches/2.1.X/src/test/java/org/jboss/cache/optimistic/AbstractOptimisticTestCase.java 2008-05-16
11:33:45 UTC (rev 5864)
+++
core/branches/2.1.X/src/test/java/org/jboss/cache/optimistic/AbstractOptimisticTestCase.java 2008-05-16
13:11:23 UTC (rev 5865)
@@ -290,6 +290,7 @@
protected List<MethodCall> injectDataVersion(List<MethodCall>
modifications)
{
List<MethodCall> newList = new LinkedList<MethodCall>();
+ if (modifications == null) return newList;
for (MethodCall c : modifications)
{
Object[] oa = c.getArgs();
Show replies by date