[jbosscache-commits] JBoss Cache SVN: r5856 - core/trunk/src/main/java/org/jboss/cache/interceptors.
jbosscache-commits at lists.jboss.org
jbosscache-commits at lists.jboss.org
Thu May 15 13:25:53 EDT 2008
Author: manik.surtani at jboss.com
Date: 2008-05-15 13:25:53 -0400 (Thu, 15 May 2008)
New Revision: 5856
Modified:
core/trunk/src/main/java/org/jboss/cache/interceptors/InvalidationInterceptor.java
Log:
fixed broken stuff
Modified: core/trunk/src/main/java/org/jboss/cache/interceptors/InvalidationInterceptor.java
===================================================================
--- core/trunk/src/main/java/org/jboss/cache/interceptors/InvalidationInterceptor.java 2008-05-15 16:07:47 UTC (rev 5855)
+++ core/trunk/src/main/java/org/jboss/cache/interceptors/InvalidationInterceptor.java 2008-05-15 17:25:53 UTC (rev 5856)
@@ -86,7 +86,12 @@
@Override
public Object visitPutKeyValueCommand(InvocationContext ctx, PutKeyValueCommand command) throws Throwable
{
- if (command.isPutForExternalRead()) return invokeNextInterceptor(ctx, command);
+ if (command.isPutForExternalRead())
+ {
+ // these are always local more, as far as invalidation is concerned
+ if (ctx.getTransaction() != null) ctx.getTransactionEntry().addLocalModification(command);
+ return invokeNextInterceptor(ctx, command);
+ }
return handleWriteMethod(ctx, command.getFqn(), null, command);
}
@@ -129,13 +134,17 @@
if (entry.hasModifications())
{
+ List<ReversibleCommand> mods;
if (entry.hasLocalModifications())
{
- PrepareCommand clone = command.clone();
- clone.removeModifications(entry.getLocalModifications());
- command = clone;
+ mods = new ArrayList<ReversibleCommand>(command.getModifications());
+ mods.removeAll(entry.getLocalModifications());
}
- broadcastInvalidate(command.getModifications(), tx, ctx);
+ else
+ {
+ mods = command.getModifications();
+ }
+ broadcastInvalidate(mods, tx, ctx);
}
else
{
@@ -356,7 +365,7 @@
protected void invalidateAcrossCluster(Fqn fqn, TransactionWorkspace workspace, boolean synchronous, InvocationContext ctx) throws Throwable
{
- if (ctx.getTransaction() != null && !isLocalModeForced(ctx))
+ if (!isLocalModeForced(ctx))
{
// increment invalidations counter if statistics maintained
incrementInvalidations();
More information about the jbosscache-commits
mailing list