[jboss-cvs] JBossCache/src/org/jboss/cache/interceptors ...
Manik Surtani
msurtani at jboss.com
Wed Dec 6 11:00:14 EST 2006
User: msurtani
Date: 06/12/06 11:00:14
Modified: src/org/jboss/cache/interceptors Tag:
Branch_JBossCache_1_4_0
OptimisticReplicationInterceptor.java
OptimisticValidatorInterceptor.java
Log:
JBCACHE-894
Revision Changes Path
No revision
No revision
1.21.2.4 +1 -0 JBossCache/src/org/jboss/cache/interceptors/OptimisticReplicationInterceptor.java
(In the diff below, changes in quantity of whitespace are not shown.)
Index: OptimisticReplicationInterceptor.java
===================================================================
RCS file: /cvsroot/jboss/JBossCache/src/org/jboss/cache/interceptors/OptimisticReplicationInterceptor.java,v
retrieving revision 1.21.2.3
retrieving revision 1.21.2.4
diff -u -b -r1.21.2.3 -r1.21.2.4
--- OptimisticReplicationInterceptor.java 13 Nov 2006 13:00:03 -0000 1.21.2.3
+++ OptimisticReplicationInterceptor.java 6 Dec 2006 16:00:14 -0000 1.21.2.4
@@ -243,6 +243,7 @@
private DataVersion getVersionToBroadcast(TransactionWorkspace w, Fqn f)
{
WorkspaceNode n = w.getNode(f);
+ if (n == null) return null;
if (w.isVersioningImplicit())
{
DefaultDataVersion v = (DefaultDataVersion) n.getVersion();
1.25.2.7 +5 -1 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.25.2.6
retrieving revision 1.25.2.7
diff -u -b -r1.25.2.6 -r1.25.2.7
--- OptimisticValidatorInterceptor.java 13 Nov 2006 13:00:03 -0000 1.25.2.6
+++ OptimisticValidatorInterceptor.java 6 Dec 2006 16:00:14 -0000 1.25.2.7
@@ -139,7 +139,7 @@
if (!workspaceNode.isCreated() )
{
// test that the 2 DataVersion types match up
- if (!realNode.getVersion().getClass().equals(workspaceNode.getVersion().getClass()))
+ if (!realNode.getVersion().getClass().equals(workspaceNode.getVersion().getClass()) && checkNotInitialRootVersion(realNode))
{
throw new DataVersioningException("Attempting to apply data version of type " + workspaceNode.getVersion().getClass() + " to a node that already contains version of type " + realNode.getVersion().getClass());
}
@@ -152,6 +152,10 @@
}
}
+ private boolean checkNotInitialRootVersion(OptimisticTreeNode n)
+ {
+ return !n.getFqn().isRoot() || !(n.getVersion() instanceof DefaultDataVersion) || n.getVersion() != DefaultDataVersion.ZERO;
+ }
private void commit(GlobalTransaction gtx)
{
More information about the jboss-cvs-commits
mailing list