-->
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: Hibernate is reexecuting a delete query
PostPosted: Tue Aug 03, 2004 10:19 am 
Newbie

Joined: Wed Apr 07, 2004 1:32 pm
Posts: 18
I having trouble finding out what I am doing wrong.

I'm trying to delete an object using session.delete, and it fails because this object is refered by other objects. I catch the exception thrown in commit, and I rollback the transaction.

After that, my app is still running, but anything I do, like an insertion, at commit time hibernate tries again to delete.

Any ideias?

Thanks,
Felipe;


Top
 Profile  
 
 Post subject:
PostPosted: Tue Aug 03, 2004 10:34 am 
Newbie

Joined: Wed Apr 07, 2004 1:32 pm
Posts: 18
I did some debugging, and realized that the collection deletions inside SessionImpl does not get cleared after rollback, so there is a ScheduledDelete (or something like that) queued there, which is been re-executed. The only method that clears this collections is session.clear().


Top
 Profile  
 
 Post subject:
PostPosted: Tue Aug 03, 2004 10:53 am 
Hibernate Team
Hibernate Team

Joined: Mon Aug 25, 2003 9:11 pm
Posts: 4592
Location: Switzerland
Immediately close and discard the Session after an exception occured, as documented.

_________________
JAVA PERSISTENCE WITH HIBERNATE
http://jpwh.org
Get the book, training, and consulting for your Hibernate team.


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.