I'm getting a foreign key constraint error when I use MySQL running under Windows 7. When I run the same MySQL and Hybernate code on Mac, it works just fine. Here are the details of the error:
09:48:40,765 ERROR JDBCExceptionReporter:101 - Cannot add or update a child row: a foreign key constraint fails (`ff`.`contingency`, CONSTRAINT `FK1F21462F65430969` FOREIGN KEY (`EEC_ID`) REFERENCES `event` (`EEC_ID`))
09:48:40,766 ERROR AbstractFlushingEventListener:324 - Could not synchronize database state with session
org.hibernate.exception.ConstraintViolationExcepti on: Could not execute JDBC batch update
I already tried simple solutions like:
SET FOREIGN_KEY_CHECKS = 0;
Do you know what is different between MySQL on Windows 7 and Mac OS which might be causing this problem?
Thanks.
09:48:40,765 ERROR JDBCExceptionReporter:101 - Cannot add or update a child row: a foreign key constraint fails (`ff`.`contingency`, CONSTRAINT `FK1F21462F65430969` FOREIGN KEY (`EEC_ID`) REFERENCES `event` (`EEC_ID`))
09:48:40,766 ERROR AbstractFlushingEventListener:324 - Could not synchronize database state with session
org.hibernate.exception.ConstraintViolationExcepti on: Could not execute JDBC batch update
I already tried simple solutions like:
SET FOREIGN_KEY_CHECKS = 0;
Do you know what is different between MySQL on Windows 7 and Mac OS which might be causing this problem?
Thanks.