-->
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: Using java.util.Calendar as timestamp for optimistic locking
PostPosted: Mon Aug 03, 2009 5:33 pm 
Newbie

Joined: Mon Aug 03, 2009 5:24 pm
Posts: 2
I have a java.util.Calendar object that needs to be used as a timestamp field for optimistic-lock. But if I try it directly, it throws an IllegalArgumentException: argument type mismatch.

It works if I use <version /> instead of <timestamp /> but I think <version /> populates it based on the previous value in the table, but timestamp uses absolute time. So it needs to be timestamp and not version.

Any ideas?


Top
 Profile  
 
 Post subject: Re: Using java.util.Calendar as timestamp for optimistic locking
PostPosted: Mon Aug 03, 2009 5:49 pm 
Newbie

Joined: Mon Aug 03, 2009 5:24 pm
Posts: 2
Apologies ... looks like I was wrong. It looks like they're exactly the same as per the following piece:

Quote:
<Timestamp> is equivalent to <version type="timestamp">. And <timestamp source="db"> is equivalent to <version type="dbtimestamp">


Source: http://docs.jboss.org/hibernate/stable/ ... -timestamp


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.