-->
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.  [ 6 posts ] 
Author Message
 Post subject: Adding TimeStamp to populated tables can't update any data
PostPosted: Sat Jun 30, 2007 11:00 pm 
Regular
Regular

Joined: Wed Oct 25, 2006 10:51 pm
Posts: 71
I've added a TimeStamp to my mapping.

But now I find that I can't update any existing data - even though I can create and update new data. Sort of a bummer really. I always get this error: Row was updated or deleted by another transaction (or unsaved-value mapping was incorrect) .


Last edited by PandaWood on Sat Jul 12, 2008 11:15 am, edited 1 time in total.

Top
 Profile  
 
 Post subject:
PostPosted: Sun Jul 01, 2007 2:04 am 
Contributor
Contributor

Joined: Wed May 11, 2005 4:59 pm
Posts: 1766
Location: Prague, Czech Republic
Which NHibernate version are you using? Which database? SQL Server? Looks like this is caused by differing precision between the timestamp in .NET and the field in the database, but this should be fixed in NHibernate 1.2.


Top
 Profile  
 
 Post subject:
PostPosted: Sun Jul 01, 2007 6:47 am 
Regular
Regular

Joined: Wed Oct 25, 2006 10:51 pm
Posts: 71
sergey wrote:
Which NHibernate version are you using? Which database? SQL Server?

Apologies, I'm using NHibernate 1.2 (1.2.0.4000) on SQL Server 2005.

I wrote a bunch of SQL like this:
Code:
alter table AccOther add [TimeStamp] [datetime]  NOT NULL default getdate()
for each table.

The values in the database look like this: '2007-06-30 17:11:21.433'
I'll see if I can figure out something based on your idea about precision...


Top
 Profile  
 
 Post subject:
PostPosted: Sun Jul 01, 2007 9:16 pm 
Regular
Regular

Joined: Wed Oct 25, 2006 10:51 pm
Posts: 71
in the meantime, I've removed the TimeStamp mapping


Last edited by PandaWood on Sat Jul 12, 2008 11:14 am, edited 1 time in total.

Top
 Profile  
 
 Post subject:
PostPosted: Mon Jul 02, 2007 12:37 am 
Regular
Regular

Joined: Wed Oct 25, 2006 10:51 pm
Posts: 71
Incidentally, I tried setting the dialect to MsSql2005 in the config string - as well as MsSql2000, it didn't have any immediate effect. That is, I still get errors.


Top
 Profile  
 
 Post subject:
PostPosted: Mon Jul 02, 2007 4:01 am 
Contributor
Contributor

Joined: Wed May 11, 2005 4:59 pm
Posts: 1766
Location: Prague, Czech Republic
Yes, if you can produce a test case, then report it.


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 6 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.