I am using Spring JDBC template to insert batches to MySql DB.
Since I use &rewriteBatchedStatements=true
, If I have a primary key violation it will fail the entire batch.
The problem is I cannot know which record is the evil one who caused the batch to fail.
All I get is BatchUpdateException with an array of -3
statuses.
I moved to use INSERT IGNORE
but I would really like to see which records failed my batch, remove it, and persist all others.
Is this possible? maybe with Hibernate 5?
Regards, Ido