-->
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.  [ 4 posts ] 
Author Message
 Post subject: UPDATE updates all fields, killing other changes.
PostPosted: Thu May 11, 2006 5:28 am 
Newbie

Joined: Tue Apr 25, 2006 4:34 am
Posts: 11
If I fetch an object from the database and change one of its fields and then save it, the sql update that is send to the database seem to update all of the colums relentlessly.

If some other process changed a value at the same time, that is overwritten when I save.

Solutions to that problem?


Top
 Profile  
 
 Post subject:
PostPosted: Thu May 11, 2006 5:36 am 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 7:19 pm
Posts: 2364
Location: Brisbane, Australia
Idealy, use optimistic locking - see version mapping tag.


Top
 Profile  
 
 Post subject:
PostPosted: Thu May 11, 2006 6:09 am 
Newbie

Joined: Tue Apr 25, 2006 4:34 am
Posts: 11
Thanks for the fast answer. But it seems like

<class dymamic-update="true"

solved the problem. Would it still be better to do the optimistic locking thing?


Top
 Profile  
 
 Post subject:
PostPosted: Thu May 11, 2006 6:51 am 
Newbie

Joined: Wed Nov 23, 2005 5:01 am
Posts: 15
Hi,

This is only half of your problem, because some process can still overwrite your changes.
So david has right, use optimistic transaction (locking) to avoid this problem.

I hope this help
Calin


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