-->
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.  [ 3 posts ] 
Author Message
 Post subject: save and/or update
PostPosted: Tue Apr 27, 2004 12:18 pm 
Newbie

Joined: Tue Apr 27, 2004 12:11 pm
Posts: 8
Location: France
Ok, I am trying to use the save() or update() method, and this is my problem : I am using a sequence identifier, and on a first database all works fine.
On a second database, I want to replicate all the values, but when I store (with save()) the same object as in my first database, I have this error :
Row was updated or deteled by another transaction (or unsaved-value was incorrect).

In fact, in my first database, the unsaved-value="null" works fine, because the sequence value is correctly generated and assigned to my object. But in the second database, the id is not null ; it has the previously generated value, and THIS IS WHAT I WANT. But I can't store it.

Why is the save() method doesn't correctly store it, and does make an update() instead ?? I tried with unsaved-value="any", but does'nt work.

I am using Hibernate 2.1.3.

Thanks.


Top
 Profile  
 
 Post subject:
PostPosted: Tue Apr 27, 2004 12:24 pm 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 12:50 pm
Posts: 5130
Location: Melbourne, Australia
Session.replicate()


Top
 Profile  
 
 Post subject:
PostPosted: Tue Apr 27, 2004 12:39 pm 
Newbie

Joined: Tue Apr 27, 2004 12:11 pm
Posts: 8
Location: France
YES !!!

Thanks a lot ; very fast response, and it works exactly as expected.


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