-->
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: Incomplete batch deletion
PostPosted: Mon Sep 28, 2015 9:07 am 
Newbie

Joined: Mon Sep 28, 2015 8:51 am
Posts: 2
Hi

I have a transaction in which all sub entries of a parent element should be deleted on a MySQL DB. Afterwards the parent element itself should be deleted.

The transaction fails due to a coinstraint violation during the deletion of the parent element, due to the fact that not all children were deleted.

The routine registers 1585 entries for deletion. 1584 sub elements and the parent element, which is correct.

The log for the first step says:
15:00:57.452 DEBUG o.h.e.d.AbstractFlushingEventListener - Flushed: 0 insertions, 0 updates, 1584 deletions to 1585 objects
15:00:57.452 DEBUG o.h.e.d.AbstractFlushingEventListener - Flushed: 0 insertions, 0 updates, 1584 deletions to 1585 objects
15:00:57.452 DEBUG o.h.e.d.AbstractFlushingEventListener - Flushed: 0 (re)creations, 0 updates, 1 removals to 1 collections
15:00:57.452 DEBUG o.h.e.d.AbstractFlushingEventListener - Flushed: 0 (re)creations, 0 updates, 1 removals to 1 collections

Now taking a look at the delete statements, only 1583 (105x 15[Batch Size] plus 1x 8) calls are made.

In the second step, where I delete the parent element I run into the constraint violation.

For some reason, this only happens in this specific case. If I create another parent with a random amount of sub elements, everything works as expected.

Due to the fact that I'm pretty desperate because I ran out of ideas what could be the reason. I would appreciate your help a lot!


Top
 Profile  
 
 Post subject: Re: Incomplete batch deletion
PostPosted: Mon Sep 28, 2015 10:25 am 
Newbie

Joined: Mon Sep 28, 2015 8:51 am
Posts: 2
Found the error. It's out of the hibernate scope


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.