I now gave it a trial to remove the cascade delete specs on the DB and only having them in the CMP Model. Also this does not work.
The DB now states a fk constraint violation that there are still child rows existings... Seems to me as the whole cascade delete logic does not work in JBOSS 3.2.1... Anyone having a clou if it is a bug?
Sounds like it is just your database constraints conflicting with what the CMP engine is attempting to do.
Either specify cascade-delete in the database and don't do it at EJB level or specify it at the EJB level and set the DB constraints to such that the CMP engine is allowed to delete the rows in its own order (which seem to violate your current DB schema referential integrity).
With the customer we're having it will be fairly difficult to get the database setup so that application Keys can be set null what seems to violate Jboss...
So I am actually using the db cascade deletes. But what happens if the JBoss runs in a cluster??? Is it working with db cascade deletes?
What is the issue with cascade-delete on a cluster? Please explain.
My solution was to just disable all my DB-constraints and now JBoss works fine with cascade delete.
But to be honest, I think the JBoss implementation of the cascade delete should follow the "common sense" logic to delete the children first and then deal with the parent.
But I'm probably wrong ;-) maybe there is some good reasons not to follow the most logical way of dealing with cascade deletes.