-->
These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 2 posts ] 
Author Message
 Post subject: ReplicationMode.LATEST_VERSION bug?
PostPosted: Mon Oct 02, 2006 6:10 pm 
Newbie

Joined: Mon Sep 13, 2004 9:44 am
Posts: 13
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.


Top
 Profile  
 
 Post subject:
PostPosted: Fri Nov 24, 2006 10:23 am 
Newbie

Joined: Tue Dec 13, 2005 7:20 am
Posts: 2
Location: Dunfermline, Scotland
Bump.

This still hasn't been fixed in 3.2.1.GA.


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 2 posts ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.