Author: manik.surtani(a)jboss.com
Date: 2008-04-12 18:59:56 -0400 (Sat, 12 Apr 2008)
New Revision: 5541
Modified:
core/trunk/src/main/java/org/jboss/cache/interceptors/PessimisticLockInterceptor.java
Log:
need to RELEASE locks as well for non-tx calls!!
Modified:
core/trunk/src/main/java/org/jboss/cache/interceptors/PessimisticLockInterceptor.java
===================================================================
---
core/trunk/src/main/java/org/jboss/cache/interceptors/PessimisticLockInterceptor.java 2008-04-12
22:59:30 UTC (rev 5540)
+++
core/trunk/src/main/java/org/jboss/cache/interceptors/PessimisticLockInterceptor.java 2008-04-12
22:59:56 UTC (rev 5541)
@@ -104,7 +104,26 @@
{
lockManager.acquireLocksWithTimeout(ctx, command.getFqn(),
NodeLock.LockType.WRITE, true, false, false, true, null, false);
}
- return invokeNextInterceptor(ctx, command);
+
+ Object retVal = invokeNextInterceptor(ctx, command);
+
+ // we NEED to unlock stuff!!! - Manik
+
+ if (ctx.getGlobalTransaction() == null && ctx.getTransaction() == null)
+ {
+ Thread current = Thread.currentThread();
+ // we are not transactional.
+ try
+ {
+ for (NodeLock nl : ctx.getInvocationLocksAcquired()) nl.release(current);
+ }
+ finally
+ {
+ ctx.clearInvocationLocksAcquired();
+ }
+ }
+
+ return retVal;
}
protected boolean skipMethodCall(InvocationContext ctx)
Show replies by date