[jboss-cvs] JBossCache/src/org/jboss/cache/interceptors ...
Manik Surtani
manik at jboss.org
Fri Jul 20 11:28:20 EDT 2007
User: msurtani
Date: 07/07/20 11:28:20
Modified: src/org/jboss/cache/interceptors
OptimisticValidatorInterceptor.java
Log:
JBCACHE-1067
Revision Changes Path
1.64 +38 -30 JBossCache/src/org/jboss/cache/interceptors/OptimisticValidatorInterceptor.java
(In the diff below, changes in quantity of whitespace are not shown.)
Index: OptimisticValidatorInterceptor.java
===================================================================
RCS file: /cvsroot/jboss/JBossCache/src/org/jboss/cache/interceptors/OptimisticValidatorInterceptor.java,v
retrieving revision 1.63
retrieving revision 1.64
diff -u -b -r1.63 -r1.64
--- OptimisticValidatorInterceptor.java 19 Jul 2007 12:56:21 -0000 1.63
+++ OptimisticValidatorInterceptor.java 20 Jul 2007 15:28:20 -0000 1.64
@@ -87,8 +87,10 @@
{
for (WorkspaceNode workspaceNode : nodes)
{
+ if (workspaceNode.isDirty())
+ {
Fqn fqn = workspaceNode.getFqn();
- if (trace) log.trace("Validating version for node " + fqn);
+ if (trace) log.trace("Validating version for node [" + fqn + "]");
NodeSPI underlyingNode;
underlyingNode = cache.peek(fqn, true);
@@ -101,12 +103,13 @@
throw new DataVersioningException("Underlying node for " + fqn + " is null, and this node wasn't newly created in this transaction! We have a concurrent deletion event.");
}
- if (underlyingNode != null && workspaceNode.isCreated() && workspaceNode.isDirty())
+ // needs to have been created AND modified - we allow concurrent creation if no data is put into the node
+ if (underlyingNode != null && workspaceNode.isCreated() && workspaceNode.isModified())
{
throw new DataVersioningException("Transaction attempted to create " + fqn + " anew. It has already been created since this transaction started, by another (possibly remote) transaction. We have a concurrent creation event.");
}
- if (!workspaceNode.isCreated() && (workspaceNode.isDeleted() || workspaceNode.isDirty()))
+ if (!workspaceNode.isCreated() && (workspaceNode.isDeleted() || workspaceNode.isModified()))
{
// if the real node is null, throw a DVE
if (underlyingNode == null)
@@ -125,6 +128,11 @@
}
}
}
+ else
+ {
+ if (trace) log.trace("Node [" + workspaceNode.getFqn() + "] doesn't need validating as it isn't dirty");
+ }
+ }
}
@@ -196,7 +204,7 @@
// notify.
}
- if (workspaceNode.isDirty())
+ if (workspaceNode.isModified())
{
log.trace("Merging data since node is dirty");
Map mergedData = workspaceNode.getMergedData();
More information about the jboss-cvs-commits
mailing list