Author: manik.surtani(a)jboss.com
Date: 2007-11-27 13:48:15 -0500 (Tue, 27 Nov 2007)
New Revision: 4783
Modified:
core/tags/2.1.0.CR2/src/main/java/org/jboss/cache/interceptors/PessimisticLockInterceptor.java
Log:
Fixed bug where nodes invalidated remotely are not detected
Modified:
core/tags/2.1.0.CR2/src/main/java/org/jboss/cache/interceptors/PessimisticLockInterceptor.java
===================================================================
---
core/tags/2.1.0.CR2/src/main/java/org/jboss/cache/interceptors/PessimisticLockInterceptor.java 2007-11-27
18:47:45 UTC (rev 4782)
+++
core/tags/2.1.0.CR2/src/main/java/org/jboss/cache/interceptors/PessimisticLockInterceptor.java 2007-11-27
18:48:15 UTC (rev 4783)
@@ -377,13 +377,13 @@
acquireNodeLock(child_node, owner, gtx, lockTypeRequired, timeout);
// make sure the lock we acquired isn't on a deleted node/is an orphan!!
- NodeSPI repeek = cache.peek(child_node.getFqn(), true);
+ NodeSPI repeek = cache.peek(child_node.getFqn(), true, true);
if (child_node != repeek)//repeek != null && child_node != repeek)//
|| repeek == null && created)
{
log.trace("Was waiting for and obtained a lock on a node that
doesn't exist anymore! Attempting lock acquisition again.");
// we have an orphan!! Lose the unnecessary lock and re-acquire the lock
(and potentially recreate the node).
// check if the parent exists!!
- if (cache.peek(n.getFqn(), true) == null)
+ if (cache.peek(n.getFqn(), true, true) == null)
{
// crap!
log.trace("Parent has been deleted again. Go through the lock
method all over again.");
@@ -398,6 +398,12 @@
// do the loop again, but don't assign child_node to n so that
child_node is processed again.
i--;
reAcquisitionOnSameNode = true;
+// retries ++;
+// if (retries == 3)
+// {
+// rerunLoop = true;
+// i = treeNodeSize;
+// }
}
continue;