[Flow] Cascade remove not working (Integrity constraint violation)

Christian Eßl essl at incert.at
Mon Sep 9 10:46:36 CEST 2013


Hi,

I have a Gallery-Model with a OneToMany-Assocation to "$images". If I delete a gallery, the images associated with this gallery should be automatically deleted as well. To accomplish that, I set "cascade={"all"}, orphanRemoval=true" in the Doctrine-Annotation.

Here is the example:
http://pastebin.com/pt1bVgcm

But when I try to delete I still get the exception:
 "An exception occurred while executing 'DELETE FROM foo_bar_domain_model_abstrac_06523 WHERE persistence_object_identifier = ?' with params ["8a3ac844-99dc-98b4-9799-e72e3f90102b"]: SQLSTATE[23000]: Integrity constraint violation: 1451 Cannot delete or update a parent row: a foreign key constraint fails (`testdb`.`foo_bar_domain_model_image`, CONSTRAINT `FK_BF430F8D472B783A` FOREIGN KEY (`gallery`) REFERENCES `foo_bar_domain_model_gallery` (`persisten) "

But why? I set the $images variable in the gallery to cascade remove all associated images, when the gallery gets deleted. Is there something else I need to set? (using TYPO3 Flow 2.0)


More information about the Flow mailing list