code: private static void populateDB(String dbName) {
          PersistenceManager pm = ZooJdoHelper.openDB(dbName);
          pm.currentTransaction().begin();
          
          // create instances
          Person lisa = new Person("Lisa");
          //make Lisa persistent. 
          pm.makePersistent(lisa);
  
          //add Bart to Lisa's friends
          Person bart = new Person("Bart");
          lisa.addFriend(bart);
          
          pm.currentTransaction().commit();
          pm.currentTransaction().begin();
          
          bart.addFriend(new Person("Maggie"));
          
          pm.currentTransaction().commit();
          closeDB(pm);
      }
docs: Populate a database.
  
  ZooDB supports persistence by reachability. This means that if 'lisa' is stored in the
  database, 'bart' will also be stored because it is referenced from 'lisa'.
  The zooActivate(...) methods in {@code Person.addFriend()} ensure that 'bart' is flagged as modified
  when {@code addFriend()} is called, so in the second part an updated 'bart' and 'maggie'
  will be stored.
  
  @param dbName Database name.