1 Reply Latest reply on Feb 13, 2003 8:57 AM by Vladica Mitrovic

    cascade-delete problem

    Mattia Newbie

      Hi, I'm using Jboss 3.0.3 and I'm testing some simple cmr relationships.
      I have 2 beans in 1-Many relationship and I specify the <cascade-delete/> option in ejb-jar.xml. Trying to delete the parent object spawns a:
      ERROR [org.jboss.ejb.GlobalTxEntityMap] Store failed on entity: fstree.ejb.TreeDataPK@59d94d77
      java.sql.SQLException: [Microsoft][SQLServer 2000 Driver for JDBC][SQLServer]Cannot insert the value NULL into column 'id', table 'MattiaDB.dbo.tree_data'; column does not allow nulls. UPDATE fails.

      uh? I thought I requested a delete...

      Anyway if I remove every constraint from the db tables (and thus allowing NULLs to be inserted), the parent object is deleted, the children objects FKs are set to NULL and an Exception is returned ("Could not remove entity").

      Am I missing something?

      I get the same behaviour in MySQL and MSSQL2000

      TIA
      --
      mattia