code: private void cascadeMarkedForInsert()
      {
          // This list was used to avoid endless recursion on circular references
          List alreadyPrepared = new ArrayList();
          for(int i = 0; i < markedForInsertList.size(); i++)
          {
              ObjectEnvelope mod = (ObjectEnvelope) markedForInsertList.get(i);
              // only if a new object was found we cascade to register the dependent objects
              if(mod.needsInsert())
              {
                  cascadeInsertFor(mod, alreadyPrepared);
                  alreadyPrepared.clear();
              }
          }
          markedForInsertList.clear();
      }
docs: Starts recursive insert on all insert objects object graph