I work with JBoss v3.2.3, MySQL v4.0.20d and MySQL Connector/J 3.0.14 (stable) JDBC 
driver.

I created one-to-many relationship between CustomerEJB-OrderEJB CMP beans. There is 
referential integrity between CUSTOMERS and ORDERS tables also cascading delete 
feature is set and it works if I delete Customer row from DB tool. I tracked JDBC 
connection to see what JBoss does under the hood when I try to delete a row from 
customer table (Customer.remove()). First I tried it without <cascade-delete/> in 
ejb-jar.xml (of course DB complaints about that), and after that I tried it with 
<cascade-delete/> but the situation is complitely the same. But the SQL under the hood 
was complitely the same. JBoss tries to set foreign keys in ORDERS table to null and 
it is not allowed by database model (I realy do not want to have orphan records in 
ORDERS table). Ok, when I use <batch-cascade-delete/> it works but I think that 
<cascade-delete/> is intended exactly for the purpose that <batch-cascade-delete/> 
does.

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

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


-------------------------------------------------------
SF.Net email is sponsored by Shop4tech.com-Lowest price on Blank Media
100pk Sonic DVD-R 4x for only $29 -100pk Sonic DVD+R for only $33
Save 50% off Retail on Ink & Toner - Free Shipping and Free Gift.
http://www.shop4tech.com/z/Inkjet_Cartridges/9_108_r285
_______________________________________________
JBoss-user mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/jboss-user

Reply via email to