-->
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: Version check by NH when Timestamp set by Database triggers
PostPosted: Fri Oct 20, 2006 7:18 pm 
Newbie

Joined: Thu Sep 14, 2006 8:52 pm
Posts: 12
In our SQL Server 2005 db tables we use columns "Create" and "Change" of datatype "Datetime" to keep track of "Inserts" and "Updates" to a row.

We have defined triggers to populate these columns. Insert a new row - "Create" gets a current timestamp. Update a row and "Change" gets updated to current timestamp.

From everything I have read on this forum and my own experiments with NH suggests - it is not possible to use NH implementing optimistic lock and rely on "Change" column to track the row version if its value is set by a trigger.

An orthogonal issue (http://forum.hibernate.org/viewtopic.ph ... highlight=) was raised by another member where Sergey acknowledged a bug.

Has any reader come up with a way to work with "Change" datetime stamp being set by db trigger and use NH effectively?

Does the NH dev team intend to support this behavior?


Top
 Profile  
 
 Post subject:
PostPosted: Fri Oct 20, 2006 8:08 pm 
Contributor
Contributor

Joined: Sat Sep 24, 2005 11:25 am
Posts: 198
NHibernate does not support version / timestamp values that come from the database.


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.