Author: mircea.markus
Date: 2008-03-10 21:48:44 -0400 (Mon, 10 Mar 2008)
New Revision: 5409
Modified:
core/trunk/src/main/java/org/jboss/cache/interceptors/OptimisticNodeInterceptor.java
core/trunk/src/test/java/org/jboss/cache/optimistic/OptimisticWithCacheLoaderTest.java
Log:
http://jira.jboss.org/jira/browse/JBCACHE-1278
Modified:
core/trunk/src/main/java/org/jboss/cache/interceptors/OptimisticNodeInterceptor.java
===================================================================
---
core/trunk/src/main/java/org/jboss/cache/interceptors/OptimisticNodeInterceptor.java 2008-03-09
22:11:12 UTC (rev 5408)
+++
core/trunk/src/main/java/org/jboss/cache/interceptors/OptimisticNodeInterceptor.java 2008-03-11
01:48:44 UTC (rev 5409)
@@ -205,11 +205,11 @@
private void addToModificationList(GlobalTransaction gtx, MethodCall m,
InvocationContext ctx)
{
Option opt = ctx.getOptionOverrides();
- if (opt == null || !opt.isCacheModeLocal())
- {
+// if (opt == null || !opt.isCacheModeLocal())
+// {
txTable.addModification(gtx, m);
if (log.isDebugEnabled()) log.debug("Adding Method " + m + " to
modification list");
- }
+// }
if (cache.getCacheLoaderManager() != null) txTable.addCacheLoaderModification(gtx,
m);
}
Modified:
core/trunk/src/test/java/org/jboss/cache/optimistic/OptimisticWithCacheLoaderTest.java
===================================================================
---
core/trunk/src/test/java/org/jboss/cache/optimistic/OptimisticWithCacheLoaderTest.java 2008-03-09
22:11:12 UTC (rev 5408)
+++
core/trunk/src/test/java/org/jboss/cache/optimistic/OptimisticWithCacheLoaderTest.java 2008-03-11
01:48:44 UTC (rev 5409)
@@ -7,6 +7,7 @@
package org.jboss.cache.optimistic;
import org.jboss.cache.CacheSPI;
+import org.jboss.cache.config.Option;
import org.jboss.cache.loader.CacheLoader;
import static org.testng.AssertJUnit.*;
import org.testng.annotations.Test;
@@ -156,6 +157,22 @@
loader.remove(fqn);
}
+ public void testCacheStoringImplicitTxOptionOverride() throws Exception
+ {
+ CacheSPI<Object, Object> cache = createCacheWithLoader();
+ CacheLoader loader = cache.getCacheLoaderManager().getCacheLoader();
+ Option option = new Option();
+ option.setCacheModeLocal(true);
+ cache.getInvocationContext().setOptionOverrides(option);
+ cache.put(fqn, key, value);
+ assertEquals(value, cache.get(fqn, key));
+ //now lets see if the state has been persisted in the cache loader
+ assertNotNull(loader.get(fqn));
+ assertNotNull(value, loader.get(fqn).get(key));
+ cache.removeNode(fqn);
+ }
+
+
public void testCacheLoading() throws Exception
{
CacheSPI<Object, Object> cache = createCacheWithLoader();