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.  [ 2 posts ] 
Author Message
 Post subject: Hibernate bulk delete of object graph
PostPosted: Thu Nov 09, 2006 9:54 pm 
Newbie

Joined: Thu Nov 09, 2006 8:46 pm
Posts: 7
I have a rich client application with Long running session ...

Now when i delete a object which has a cascade delete relation ..it issues a seprate sql query for each item in the collection ..

for example Order-->*OrderItems

session.delte(order)

N sql deltes for N OrderItems
1 sql delete for Order

OPTION 1: I can manually delte using sql statements myself because but that would cause my long running session cache to become corrupt .

OPTION 2 : Use bulk delete for each collection , but that has the same problem as above as stated in the ejb spec

[/quote]The persistence context is not synchronized with the result of the bulk update or delete.
Caution should be used when executing bulk update or delete operations because they may result in
inconsistencies between the database and the entities in the active persistence context. [quote]


Any ideas on how to deal with N+1 delete problem ??


Hibernate version: 3.1.2

Name and version of the database you are using: HSQLDB

PS : Tenwit where have u been ??


Top
 Profile  
 
 Post subject:
PostPosted: Wed Nov 15, 2006 7:34 pm 
Senior
Senior

Joined: Sun Jun 04, 2006 1:58 am
Posts: 136
you can structure you application around the fact that you can use
session.clear() /session.evict() once you manually delete

_________________
Don't forget to rate


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