When I call remove for a model that has a hasMany association, it fails because a foreign key reference is still there (ER_ROW_ISREFERENCED: Cannot delete or update a parent row: a foreign key constraint fails). Debugging the query shows me that the cascade remove is being applied because the row that has the foreign key is being deleted first. The problem seems to be that orm is trying to delete the model before the associations are removed completely removed. Can someone confirm this? I am using mysql.
I think I solved the problem. What was causing this was the fact that I was using a connection pool. If I don't use a connection pool, the cascade remove is applied with success.
When I call remove for a model that has a hasMany association, it fails because a foreign key reference is still there (ER_ROW_ISREFERENCED: Cannot delete or update a parent row: a foreign key constraint fails). Debugging the query shows me that the cascade remove is being applied because the row that has the foreign key is being deleted first. The problem seems to be that orm is trying to delete the model before the associations are removed completely removed. Can someone confirm this? I am using mysql.