1 Reply Latest reply on Jul 20, 2002 2:54 PM by Dain Sundstrom

    CMP cascade-delete bug?

    Sergei Batiuk Newbie

      Hello,

      I have Four EJBs: TreeNode, Group, Department and Position. The Tree bean is used to represent a hierarchical structure of Groups, Departments and Positions. Each TreeNode points to a parent TreeNode and points to either Group or Department or Position. The deployment descriptor indicates by use of <cascade-delete/> that when remove() method is invoked on TreeNode, all child TreeNodes should be removed, and any associated Group or Department or Position. When I invoke remove() method on TreeNode, all the child TreeNodes are removed correctly, but neither group, nor Department nor Position gets removed.

      Is this a bug? Here are relations between ejbs in my ejb-jar.xml:


      <!--PersonnelTree - Position -->
      <ejb-relation>
      <ejb-relation-name>PersonnelTree-Position</ejb-relation-name>
      <ejb-relationship-role>
      treeNode
      <ejb-relationship-role-name>PersonnelTreeRelationshipRole</ejb-relationship-role-name>
      Many
      <cascade-delete />
      <relationship-role-source>
      treeNode
      <ejb-name>TreeNode</ejb-name>
      </relationship-role-source>
      <cmr-field>
      position
      <cmr-field-name>position</cmr-field-name>
      </cmr-field>
      </ejb-relationship-role>
      <ejb-relationship-role>
      position
      <ejb-relationship-role-name>PositionRelationshipRole</ejb-relationship-role-name>
      One
      <relationship-role-source>
      position
      <ejb-name>Position</ejb-name>
      </relationship-role-source>
      </ejb-relationship-role>
      </ejb-relation>
      <!--PersonnelTree - Department -->
      <ejb-relation>
      <ejb-relation-name>PersonnelTree-Department</ejb-relation-name>
      <ejb-relationship-role>
      treeNode
      <ejb-relationship-role-name>PersonnelTreeRelationshipRole</ejb-relationship-role-name>
      Many
      <cascade-delete />
      <relationship-role-source>
      treeNode
      <ejb-name>TreeNode</ejb-name>
      </relationship-role-source>
      <cmr-field>
      department
      <cmr-field-name>department</cmr-field-name>
      </cmr-field>
      </ejb-relationship-role>
      <ejb-relationship-role>
      department
      <ejb-relationship-role-name>DepartmentRelationshipRole</ejb-relationship-role-name>
      One
      <relationship-role-source>
      department
      <ejb-name>Department</ejb-name>
      </relationship-role-source>
      </ejb-relationship-role>
      </ejb-relation>
      <!--PersonnelTree - Group -->
      <ejb-relation>
      <ejb-relation-name>PersonnelTree-Group</ejb-relation-name>
      <ejb-relationship-role>
      treeNode
      <ejb-relationship-role-name>PersonnelTreeRelationshipRole</ejb-relationship-role-name>
      Many
      <cascade-delete />
      <relationship-role-source>
      treeNode
      <ejb-name>TreeNode</ejb-name>
      </relationship-role-source>
      <cmr-field>
      group
      <cmr-field-name>group</cmr-field-name>
      </cmr-field>
      </ejb-relationship-role>
      <ejb-relationship-role>
      group
      <ejb-relationship-role-name>GroupRelationshipRole</ejb-relationship-role-name>
      One
      <relationship-role-source>
      group
      <ejb-name>Group</ejb-name>
      </relationship-role-source>
      </ejb-relationship-role>
      </ejb-relation>
      <!--PersonnelTree - And it's parent -->
      <ejb-relation>
      <ejb-relation-name>TreeNodeParent-TreeNodeChild</ejb-relation-name>
      <ejb-relationship-role>
      treeNode
      <ejb-relationship-role-name>TreeNodeChildRelationshipRole</ejb-relationship-role-name>
      Many
      <cascade-delete />
      <relationship-role-source>
      treeNode
      <ejb-name>TreeNode</ejb-name>
      </relationship-role-source>
      <cmr-field>
      treeNode
      <cmr-field-name>parent</cmr-field-name>
      </cmr-field>
      </ejb-relationship-role>
      <ejb-relationship-role>
      treeNode
      <ejb-relationship-role-name>TreeNodeParentRelationshipRole</ejb-relationship-role-name>
      One
      <relationship-role-source>
      treeNode
      <ejb-name>TreeNode</ejb-name>
      </relationship-role-source>
      </ejb-relationship-role>
      </ejb-relation>