-->
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: Check if object has changed in the database
PostPosted: Thu Nov 12, 2009 12:34 pm 
Newbie

Joined: Wed Nov 04, 2009 10:49 am
Posts: 4
Hi,
I have bound an object to the session. While the session is open I want to check if the object has been modified
in the database (the object is not changed in the session!!).

Something like this:

Code:
O object = Session.get(O.class, id)

// do something with other objects in the session
session.saveOrUpdate(anotherObject);
...
...

-> finally check here if object has been modified in the database


I tried to use optimistic locking but I could not get it to work if the object has not been changed in the session.
Currently I manually check for modifications.

So is there another way to find out if the object has been changed?

Best Regards
Carsten


Top
 Profile  
 
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.