Author: bstansberry(a)jboss.com
Date: 2008-02-27 16:13:24 -0500 (Wed, 27 Feb 2008)
New Revision: 14374
Modified:
core/trunk/cache-jbosscache2/src/main/java/org/hibernate/cache/jbc2/util/DataVersionAdapter.java
Log:
If we see a JBC DefaultDataVersion, we are newer
Modified:
core/trunk/cache-jbosscache2/src/main/java/org/hibernate/cache/jbc2/util/DataVersionAdapter.java
===================================================================
---
core/trunk/cache-jbosscache2/src/main/java/org/hibernate/cache/jbc2/util/DataVersionAdapter.java 2008-02-27
18:36:51 UTC (rev 14373)
+++
core/trunk/cache-jbosscache2/src/main/java/org/hibernate/cache/jbc2/util/DataVersionAdapter.java 2008-02-27
21:13:24 UTC (rev 14374)
@@ -89,15 +89,16 @@
log.trace("skipping lock checks...");
return false;
} else if (dataVersion instanceof DefaultDataVersion) {
- if (((DefaultDataVersion) dataVersion).getRawVersion() == 0) {
- // JBC put a version in the node when it created it as
- // part of building a larger tree
- return true;
- } else {
- log.error("Cannot compare to " + dataVersion);
- return false;
+ // JBC put a version in the node when it created as part of
+ // some internal operation. We are always newer, but if
+ // the JBC version is > 1 something odd has happened
+ if (((DefaultDataVersion) dataVersion).getRawVersion() > 1) {
+ log.warn("Unexpected comparison to " + dataVersion +
+ " -- we are " + toString());
}
+ return true;
}
+
DataVersionAdapter other = (DataVersionAdapter) dataVersion;
if (other.previousVersion == null) {
log.warn("Unexpected optimistic lock check on inserting data");
Show replies by date