[jboss-user] [Persistence, JBoss/CMP, Hibernate, Database] - Cascade.REMOVE not working between EJBs in different jars

icordoba do-not-reply at jboss.com
Wed Dec 10 07:33:20 EST 2008

Hi there, 
I am having a problem with Hibernate which I don't know if it is a problem or the regular behaviour. 
Cascade.REMOVE is working fine for me but only between EJBs in the same .JAR (several jars, each for a differente "module" are packed in an .ear for my application) 
I deploy a .ear file with EJBs grouped in different jars. Some times there are MANY-TO-ONE referentes from EJBs in these different jars. Every thing works OK with these EJBs even they are placed in different jars. My only problem is that removing a EJB will not remove the corresponding side of the relation y the EJB is in another jar file. 

The only way I have found to solve this is manually adding "on delete cascade" in the MySQL schema, but it is important for me that the database scheme created by JBoss/Hibernate when I deploy de .ear is fully funcional not requiring manual modifications.

By the way, should Hibernate add "on delete cascade" constraint when creating the data base schema? It isn't now, but it manages OK cascade removing in EJBs in the same jar anyway. 

I don't use any Hibernate specific feature. Just EJB3 annotations and I am using JBoss 4 as EJB container. 

Thanks for any help/ideas 


View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4195588#4195588

Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4195588

More information about the jboss-user mailing list