Hibernate version:2.1.8
Exception:
net.sf.hibernate.exception.ConstraintViolationException: Could not execute JDBC batch update
Database: MySQL 4
I have a problem that could be solved if I could give a certain priority to each operation executed during the Batch Update when commiting the transacton.
The problem is that certain table rows have to be deleted before inserting new ones due to foreign key restrictions. Both deletion and creation of new objects are executed during the same hibernate transaction but when commiting hibernate tries to insert the new rows first.
In other contexts, when the new rows inserted do not violate the constraint, everything works perfectly, because old objects (rows) are deleted at the end of the sql batch update.
To make matters worse, I cannot separate these two operations in two different transactions, because data consistency would be at risk.
_________________ Pablo N. Alvarez
Austral University
Argentina
|