It is not possible. I can catch the exception but cannot continue. Because I commit outside for-loop. So, when exception is thrown, it means none of the records got inserted, I can catch the exception, but my problem still there. I would like to have some option in hibernate if possible rather than doing something in java try-catch stuff. The option should tell hibernate to continue inserting records even if any single record has some issue in the batch of many records coming in with single commit.
I'm using the Hibernate's session.save() method to save many objects. Thanks & Regards, Rengesh Babu mraible wrote: > > You could try catching the exception. > > Matt > > On Wed, Feb 18, 2009 at 4:10 AM, RengeshBabu <rengesh...@yahoo.co.in> > wrote: > >> >> Hi, >> In my application, I use for-loop to save many objects. Outside for-loop, >> I >> commit. I have unique index set in table with some columns. If there is >> duplicate record tried to insert, hibernate throws exception. I want to >> avoid getting exception and just continue with other unique records >> available. How can I do this? >> >> Thanks & Regards, >> Rengesh Babu >> -- >> View this message in context: >> http://www.nabble.com/Ignoring-insert-errors-while-inserting-in-hibernate-tp22076551s2369p22076551.html >> Sent from the AppFuse - User mailing list archive at Nabble.com. >> >> >> --------------------------------------------------------------------- >> To unsubscribe, e-mail: users-unsubscr...@appfuse.dev.java.net >> For additional commands, e-mail: users-h...@appfuse.dev.java.net >> >> > > -- View this message in context: http://www.nabble.com/Ignoring-insert-errors-while-inserting-in-hibernate-tp22076551s2369p22096820.html Sent from the AppFuse - User mailing list archive at Nabble.com. --------------------------------------------------------------------- To unsubscribe, e-mail: users-unsubscr...@appfuse.dev.java.net For additional commands, e-mail: users-h...@appfuse.dev.java.net