-->
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.  [ 1 post ] 
Author Message
 Post subject: Using timestamp for custom purposes
PostPosted: Wed Jun 01, 2005 5:22 am 
Hi,

the doc states (3.1.8 - timestamp):

Quote:
The optional <timestamp> element indicates that the table contains timestamped data. This is intended as an alternative to versioning. Timestamps are by nature a less safe implementation of optimistic locking. However, sometimes the application might use the timestamps in other ways.


I used to have a DateTime column named LastUpdateDate which I updated each time my object get modified. The drawback of this method is that when I call NH to saveorupdate the object with no dirty field except LastUpdateDate, I get an unnecessary database update...

I thought of using a <timestamp> declaration instead of a <column>.

If I do so and no field is dirty, will NH skip the update of the object ? Or will it update the object with only the timestamp modified ?

As an application "might use the timestamp in other ways" such as this one, am I ensured that this usage will still be supported later ?

kind regards

Thibaut


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

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.