Hi there,
I'm trying to delete an object which has a OneToMany Relationship
Father
Children
EJB3
Error stack trace
16:06:40,671 ERROR [JDBCExceptionReporter] Cannot delete or update a parent row: a foreign key constraint fails (`test/USR_ADDRESS`, CONSTRAINT `FK949D64094F8AB6BC` FOREIGN KEY (`user_fk_id`) REFERENCES `USR` (`id`))
16:06:40,672 ERROR [AbstractFlushingEventListener] Could not synchronize database state with session
org.hibernate.exception.ConstraintViolationException: Could not execute JDBC batch update
Caused by: java.sql.BatchUpdateException: Cannot delete or update a parent row: a foreign key constraint fails (`test/USR_ADDRESS`, CONSTRAINT `FK949D64094F8AB6BC` FOREIGN KEY (`user_fk_id`) REFERENCES `USR` (`id`))
at com.mysql.jdbc.PreparedStatement.executeBatchSerially(PreparedStatement.java:1213)
With EJB3, the transaction is not managed by the container?
What am I missing here?
Thanks in advance