[jboss-cvs] JBossCache/src/org/jboss/cache/interceptors ...
Manik Surtani
msurtani at jboss.com
Wed Dec 6 06:44:22 EST 2006
User: msurtani
Date: 06/12/06 06:44:22
Modified: src/org/jboss/cache/interceptors Tag:
Branch_JBossCache_1_4_0
PessimisticLockInterceptor.java
Log:
ported fixes for JBCACHE-871 and JBCACHE-875 from the 1.3.0 branch
Revision Changes Path
No revision
No revision
1.20.2.4 +4 -6 JBossCache/src/org/jboss/cache/interceptors/PessimisticLockInterceptor.java
(In the diff below, changes in quantity of whitespace are not shown.)
Index: PessimisticLockInterceptor.java
===================================================================
RCS file: /cvsroot/jboss/JBossCache/src/org/jboss/cache/interceptors/PessimisticLockInterceptor.java,v
retrieving revision 1.20.2.3
retrieving revision 1.20.2.4
diff -u -b -r1.20.2.3 -r1.20.2.4
--- PessimisticLockInterceptor.java 5 Dec 2006 17:16:35 -0000 1.20.2.3
+++ PessimisticLockInterceptor.java 6 Dec 2006 11:44:22 -0000 1.20.2.4
@@ -36,7 +36,7 @@
* current method and unlock when the method returns.
*
* @author Bela Ban
- * @version $Id: PessimisticLockInterceptor.java,v 1.20.2.3 2006/12/05 17:16:35 msurtani Exp $
+ * @version $Id: PessimisticLockInterceptor.java,v 1.20.2.4 2006/12/06 11:44:22 msurtani Exp $
*/
public class PessimisticLockInterceptor extends Interceptor
{
@@ -275,7 +275,7 @@
}
// reverse the "remove" if the node has been previously removed in the same tx, if this operation is a put()
- if (needToReverseRemove(child_node, tx_table.get(gtx), lock_type, isRemoveNodeOperation))
+ if (gtx != null && needToReverseRemove(child_node, tx_table.get(gtx), lock_type, isRemoveNodeOperation, createIfNotExists))
{
reverseRemove(child_node);
}
@@ -309,9 +309,9 @@
if (isRemoveNodeOperation && gtx != null) cache.getTransactionTable().get(gtx).addRemovedNode(fqn);
}
- private boolean needToReverseRemove(DataNode n, TransactionEntry te, int lockTypeRequested, boolean isRemoveOperation)
+ private boolean needToReverseRemove(DataNode n, TransactionEntry te, int lockTypeRequested, boolean isRemoveOperation, boolean createIfNotExists)
{
- return !isRemoveOperation && lockTypeRequested == DataNode.LOCK_TYPE_WRITE && cache.isMarkedForRemoval(n) && te.getRemovedNodes().contains(n.getFqn());
+ return !isRemoveOperation && createIfNotExists && lockTypeRequested == DataNode.LOCK_TYPE_WRITE && cache.isMarkedForRemoval(n) && te.getRemovedNodes().contains(n.getFqn());
}
private void reverseRemove(DataNode n)
@@ -445,9 +445,7 @@
*/
private void rollback(GlobalTransaction tx)
{
- List undo_ops;
TransactionEntry entry = tx_table.get(tx);
- MethodCall undo_op;
if (log.isTraceEnabled())
log.trace("called to rollback cache with GlobalTransaction=" + tx);
More information about the jboss-cvs-commits
mailing list