-->
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: Rollback
PostPosted: Thu Jul 03, 2008 9:25 am 
Newbie

Joined: Thu Jul 03, 2008 9:17 am
Posts: 1
Please help to Resolve following scenario.

I have to insert 500 record in database using CMP beans and hibernate.

Some exception happens when their is insertion for 201 record & 203 record.

My Goal is that the system should not rollback the whole transaction but rather should save all the records except 201th and 203rd record.


Top
 Profile  
 
 Post subject:
PostPosted: Fri Jul 04, 2008 1:36 pm 
Expert
Expert

Joined: Tue May 13, 2008 3:42 pm
Posts: 919
Location: Toronto & Ajax Ontario www.hibernatemadeeasy.com
Well, if each write should be a single unit of work, then each write needs to be placed within a single open and closed transaction. That way, only the failed records will fail.

Sometimes ETL tools are better at large batch updates than programs written with Hibernate. 500 records isn't that huge though. If it got to 5,000, or 50,000, I might change my tune though.

Let us know how it works!

_________________
Cameron McKenzie - Author of "Hibernate Made Easy" and "What is WebSphere?"
http://www.TheBookOnHibernate.com Check out my 'easy to follow' Hibernate & JPA Tutorials


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.