Hibernate version: 3.1.2, trunk
The docs for ReplicationMode.LATEST_VERSION say "overwrite the row if its version number is earlier than the version number of the object, or ignore the object otherwise". However, an UPDATE is always issued if the version numbers are the same...
Code:
public static final ReplicationMode LATEST_VERSION = new ReplicationMode("LATEST_VERSION") {
public boolean shouldOverwriteCurrentVersion(Object entity, Object currentVersion, Object newVersion, VersionType versionType) {
if (versionType==null) return true; //always overwrite nonversioned data
return versionType.getComparator().compare(currentVersion, newVersion) <= 0;
}
};
Shouldn't that be < 0?
I can work around by instantiating my own version of LATEST_VERSION with the comparison fixed.
Regards,
Chris.