This is a discussion on Exception when trying to update/remove beans with 1:n relationship - Websphere ; I am developing an EJB app with WSSAD 5.1.2 and I'm using CMP entity beans. I have a problem with a 1:n relationthip between two entities, let's say, 'A' and 'B', in wich one 'A' entity relates to many 'B's ...
I am developing an EJB app with WSSAD 5.1.2 and I'm using CMP entity beans. I have a problem with a 1:n relationthip between two entities, let's say, 'A' and 'B', in wich one 'A' entity relates to many 'B's entities. Later, in a session bean (using CMT) method call, I remove all the 'B' associations of an instance of 'A' and then delete that instance of 'A'. When the method reaches to its end (when i assume the container commits the transaction) I get an exception with a DB2 error SQL0532N indicating that the row in table 'A' cannot be deleted because of the relationship with table 'B' ("a parent row cannot be deleted..."), wich means the associations between the instances of B and the instance of A were not removed previously. So, I set breakpoints in the deployment code of both 'A' and 'B' where the sql statements are executed and i find this: The update of 'B' instances is never called, at least not before the delete of 'A' instance is called. So my question is: am I doing something wrong, I just missed something? may be a bug in the ejb container's transaction support? How can i 'force' the container to call the update statements before the delete statement?
Thanks in advance for your help!!