-->
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: Recovering Objects state if delete fails
PostPosted: Sat Jan 03, 2004 4:30 pm 
Newbie

Joined: Sun Nov 30, 2003 4:46 am
Posts: 17
Hi,
I have a class A that has a many-to-many relationship with class B and their relationship is bidirectional.
I want to break the link between the 2 by deleting a record from their associative entity. For that I remove B's instance from the collection in A and also remove A's instance from the collection in B and then perform session.delete(A_object).
If for any reason the delete operation fails the objects of A and B are left in an inconsistent state from that of the DB. One way of recoveing their state is to load them again but that would mean increased DB access that is accessing DB once for delete, twice for loading A and B objects.
Is their any other better and efficient alternative to recovering Objects' state if delete fails and make their state consistent with that of the DB
Am I missing something here?

Thanx in advance for any suggstions and tips


Top
 Profile  
 
 Post subject:
PostPosted: Sun Jan 04, 2004 2:37 am 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 12:50 pm
Posts: 5130
Location: Melbourne, Australia
No, we do nt yet have object-level rollback. Its a bit of a performance killer and not needed by most people. I do intend tyo eventually add this as an optional feature (perhaps using named savepoints).


Top
 Profile  
 
 Post subject:
PostPosted: Sun Jan 04, 2004 8:32 am 
Newbie

Joined: Sun Nov 30, 2003 4:46 am
Posts: 17
Fine then under the current limitations what strategy should be used for recovering the objects' state?
I mean which approach is better suited for this?


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.