-->
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: Catching RollbackException?
PostPosted: Thu Feb 18, 2016 11:03 pm 
Regular
Regular

Joined: Wed Jan 21, 2009 8:41 pm
Posts: 54
If I want to get a BatchUpdateException then is it typical to have to catch the RollbackException get it's cause and then follow it's sqlexception to get the BatchUpdateException so you can then look at the update counts and then in my case kick out the offending record from the batch (a collection) and then try again?


Top
 Profile  
 
 Post subject: Re: Catching RollbackException?
PostPosted: Mon Feb 22, 2016 8:27 am 
Hibernate Team
Hibernate Team

Joined: Thu Sep 11, 2014 2:50 am
Posts: 1628
Location: Romania
Usually, when you get an exception, you have to close the Session and notify the caller of what went wrong.
Retrying makes sense for some specific use cases like optimistic locking or a timeout.
When the incoming changes violate a constraint, retrying does not make sense since that request will always fail.


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.