Lots of times in Java logs I\'ll get something like:
Caused by: java.sql.BatchUpdateException: failed batch
at org.hsqldb.jdbc.jdbcStatement.executeBatch
In a blog post I just described how to get more than just "BatchUpdateException: failed batch": set hibernate.jdbc.factory_class=org.hibernate.jdbc.NonBatchingBatcherFactory
to disable batching in hibernate.
Normally one can use BatchUpdateException.getNextException
to get the reason of the failure, but in some cases this may return null
. Then it's useful to disable batching completely.