code: private ArrayList handleDependentCollections(Identity oid, Object obj,
              Object[] origCollections, Object[] newCollections,
              Object[] newCollectionsOfObjects)
              throws LockingException
      {
          ClassDescriptor mif = _pb.getClassDescriptor(obj.getClass());
          Collection colDescs = mif.getCollectionDescriptors();
          ArrayList newObjects = new ArrayList();
          int count = 0;
  
          for (Iterator it = colDescs.iterator(); it.hasNext(); count++)
          {
              CollectionDescriptor cds = (CollectionDescriptor) it.next();
  
              if (cds.getOtmDependent())
              {
                  ArrayList origList = (origCollections == null ? null
                                          : (ArrayList) origCollections[count]);
                  ArrayList newList = (ArrayList) newCollections[count];
  
                  if (origList != null)
                  {
                      for (Iterator it2 = origList.iterator(); it2.hasNext(); )
                      {
                          Identity origOid = (Identity) it2.next();
  
                          if ((newList == null) || !newList.contains(origOid))
                          {
                              markDelete(origOid, oid, true);
                          }
                      }
                  }
  
                  if (newList != null)
                  {
                      int countElem = 0;
                      for (Iterator it2 = newList.iterator(); it2.hasNext(); countElem++)
                      {
                          Identity newOid = (Identity) it2.next();
  
                          if ((origList == null) || !origList.contains(newOid))
                          {
                              ContextEntry entry = (ContextEntry) _objects.get(newOid);
  
                              if (entry == null)
                              {
                                  ArrayList relCol = (ArrayList)
                                          newCollectionsOfObjects[count];
                                  Object relObj = relCol.get(countElem);
                                  insertInternal(newOid, relObj, LockType.WRITE_LOCK,
                                                 true, null, new Stack());
                                  newObjects.add(newOid);
                              }
                          }
                      }
                  }
              }
          }
  
          return newObjects;
      }
docs: Mark for creation all objects that were included into dependent collections.
  Mark for deletion all objects that were excluded from dependent collections.