PersistenceManager pm = pmf.getPersistenceManager();
pm.currentTransaction().begin();
final String r2bb_id = "testRef2BasicB_r2bb_id";
final String bb_id = "testRef2BasicB_bb_id";
BasicB bb = new BasicB(bb_id, 1);
Ref2BasicB r2bb = new Ref2BasicB(r2bb_id);
pm.makePersistent(r2bb);
r2bb.setBasicb(bb);
pm.getObjectId(bb);
pm.currentTransaction().commit();
pm.evict(r2bb);
pm.evict(bb);
pm.close();
pm = pmf.getPersistenceManager();
pm.currentTransaction().begin();
Object o = pm.getObjectById(
pm.newObjectIdInstance(Ref2BasicB.class, r2bb_id), false);
assertTrue("Bad object ", o==r2bb);
pm.deletePersistent(r2bb.getBasicb());
pm.deletePersistent(r2bb);
pm.currentTransaction().commit();
pm.close();
}