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: Saving detached objects back to database
PostPosted: Fri Nov 26, 2010 4:21 am 
Newbie

Joined: Fri Nov 26, 2010 2:32 am
Posts: 3
Once a session is closed. The application may have detached object provided its not evicted in session. Now in the mean time, some modifications happen to the corresponding persistent object and is saved back to the database. Now we open up new session and attach the detached object to session using session.merge(obj). Now as per my understanding, this time we we will get an exception and our commit would fail as versioning is changed since the first time the object was read into memory(which became datached object) till the time we are attaching it to session using session.merge()

If my understanding is correct then, we cant use detached objects in clustered web environment where several threads might be accessing/modifying database objects. How to deal with this situation?


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.