1 Reply Latest reply on Jan 9, 2003 8:27 AM by Steinar Overbeck Cook

    how to correctly remove CMR managed child entities?

    Steinar Overbeck Cook Newbie

      Given two EJBs "Master" -----(1..*) ---> "Detail".

      What is the corret way of removing all "Detail" objects belonging to "Master" ?

      I have tried this:

      for (Iterator iter=master.getDetails().iterator();iter.hasNext();) {
      Detail detail = (Detail)iter.next();
      detail.remove();
      }

      But only the first of two "Detail" objects are removed.

      Where did I go wrong?