Author: manik.surtani(a)jboss.com
Date: 2008-07-01 09:39:03 -0400 (Tue, 01 Jul 2008)
New Revision: 6140
Modified:
core/trunk/src/main/java/org/jboss/cache/interceptors/InvocationContextInterceptor.java
core/trunk/src/main/java/org/jboss/cache/invocation/LegacyInvocationContext.java
core/trunk/src/test/java/org/jboss/cache/options/ForceWriteLockTest.java
Log:
Fixed wiping of context
Modified:
core/trunk/src/main/java/org/jboss/cache/interceptors/InvocationContextInterceptor.java
===================================================================
---
core/trunk/src/main/java/org/jboss/cache/interceptors/InvocationContextInterceptor.java 2008-07-01
13:33:42 UTC (rev 6139)
+++
core/trunk/src/main/java/org/jboss/cache/interceptors/InvocationContextInterceptor.java 2008-07-01
13:39:03 UTC (rev 6140)
@@ -206,8 +206,10 @@
ctx.setCommand(null);
ctx.setMethodCall(null);
-
- ctx.reset();
+ // TODO: Calling ctx.reset() here breaks stuff. Check whether this is just
becuse UTs expect stuff in the ctx or whether this really breaks functionality.
+// ctx.reset();
+ // instead, for now, just wipe contents of the looked up node map
+ ctx.clearLookedUpNodes();
}
}
Modified:
core/trunk/src/main/java/org/jboss/cache/invocation/LegacyInvocationContext.java
===================================================================
---
core/trunk/src/main/java/org/jboss/cache/invocation/LegacyInvocationContext.java 2008-07-01
13:33:42 UTC (rev 6139)
+++
core/trunk/src/main/java/org/jboss/cache/invocation/LegacyInvocationContext.java 2008-07-01
13:39:03 UTC (rev 6140)
@@ -33,7 +33,7 @@
public void clearLookedUpNodes()
{
- throw new UnsupportedOperationException("Should not be called on legacy
locking schemes!");
+ // no-op
}
public Map<Fqn, NodeSPI> getLookedUpNodes()
Modified: core/trunk/src/test/java/org/jboss/cache/options/ForceWriteLockTest.java
===================================================================
--- core/trunk/src/test/java/org/jboss/cache/options/ForceWriteLockTest.java 2008-07-01
13:33:42 UTC (rev 6139)
+++ core/trunk/src/test/java/org/jboss/cache/options/ForceWriteLockTest.java 2008-07-01
13:39:03 UTC (rev 6140)
@@ -6,8 +6,10 @@
import org.jboss.cache.Fqn;
import org.jboss.cache.NodeSPI;
import org.jboss.cache.config.Configuration;
+import org.jboss.cache.config.Configuration.NodeLockingScheme;
import org.jboss.cache.lock.LockManager;
import org.jboss.cache.lock.LockType;
+import org.jboss.cache.transaction.DummyTransactionManagerLookup;
import org.jboss.cache.util.TestingUtil;
import static org.testng.AssertJUnit.assertTrue;
import org.testng.annotations.AfterMethod;
@@ -22,7 +24,7 @@
* @author <a href="mailto:manik@jboss.org">Manik Surtani</a>
* @since 2.0.0
*/
-@Test(groups = {"functional"})
+@Test(groups = {"functional", "pessimistic"})
public class ForceWriteLockTest
{
private CacheSPI<String, String> cache;
@@ -33,7 +35,8 @@
public void setUp()
{
Configuration c = new Configuration();
-
c.setTransactionManagerLookupClass("org.jboss.cache.transaction.DummyTransactionManagerLookup");
+ c.setTransactionManagerLookupClass(DummyTransactionManagerLookup.class.getName());
+ c.setNodeLockingScheme(NodeLockingScheme.PESSIMISTIC);
CacheFactory<String, String> instance = new DefaultCacheFactory<String,
String>();
cache = (CacheSPI<String, String>) instance.createCache(c);
tm = cache.getTransactionManager();
Show replies by date