... until the collector arrives ...

This "blog" is really just a scratchpad of mine. There is not much of general interest here. Most of the content is scribbled down "live" as I discover things I want to remember. I rarely go back to correct mistakes in older entries. You have been warned :)

2006-08-28

ALDSP Cascaded Deletes

Using ALDSP, there are problems if you try to delete an object that owns its children (and both are mapped into the same document).  Even though ALDSP inspects the foreign key constraints, it does not use this information to figure out cascaded deletes.  If you simply delete the parent object, you will get an exception like:

com.bea.ld.dsmediator.DataServiceException:
  java.sql.SQLException: [BEA][SQLServer JDBC Driver][SQLServer]
    DELETE statement conflicted with COLUMN REFERENCE constraint 'FK_ITEM_FACT'.
    The conflict occurred in database 'mmsandbox', table 'FACT', column 'ITEM_ID'.

To perform a cascaded delete successfully, you must first delete all of the child nodes from the data graph, then the parent node.  When you submit the altered data graph, it will do the right thing (in the right order, apparently, not in alphabetical order as claimed in the 2.1 release notes).

Blog Archive