Author: manik.surtani(a)jboss.com
Date: 2008-05-28 05:14:50 -0400 (Wed, 28 May 2008)
New Revision: 5893
Modified:
core/trunk/src/main/java/org/jboss/cache/interceptors/PessimisticLockInterceptor.java
core/trunk/src/test/java/org/jboss/cache/transaction/PrepareTxTest.java
Log:
Shouldnt just test for a null tx
Modified:
core/trunk/src/main/java/org/jboss/cache/interceptors/PessimisticLockInterceptor.java
===================================================================
---
core/trunk/src/main/java/org/jboss/cache/interceptors/PessimisticLockInterceptor.java 2008-05-27
20:13:32 UTC (rev 5892)
+++
core/trunk/src/main/java/org/jboss/cache/interceptors/PessimisticLockInterceptor.java 2008-05-28
09:14:50 UTC (rev 5893)
@@ -300,7 +300,7 @@
@Override
public void doAfterCall(InvocationContext ctx, VisitableCommand command)
{
- if (ctx.getTransaction() == null) lockManager.unlock(ctx);
+ if (!ctx.isValidTransaction()) lockManager.unlock(ctx);
}
/**
Modified: core/trunk/src/test/java/org/jboss/cache/transaction/PrepareTxTest.java
===================================================================
--- core/trunk/src/test/java/org/jboss/cache/transaction/PrepareTxTest.java 2008-05-27
20:13:32 UTC (rev 5892)
+++ core/trunk/src/test/java/org/jboss/cache/transaction/PrepareTxTest.java 2008-05-28
09:14:50 UTC (rev 5893)
@@ -28,7 +28,7 @@
@BeforeMethod(alwaysRun = true)
public void setUp() throws Exception
{
- CacheFactory<String, String> instance = new DefaultCacheFactory();
+ CacheFactory<String, String> instance = new DefaultCacheFactory<String,
String>();
cache = (CacheSPI<String, String>) instance.createCache(false);
cache.getConfiguration().setCacheMode("local");
cache.getConfiguration().setTransactionManagerLookupClass(TransactionSetup.getManagerLookup());
Show replies by date