*/
public class JDORecursiveParentTest extends JDOTestCase {
public void testCreateParentAndChildDifferentTxn() {
HasRecursiveParent p = new HasRecursiveParent();
p.setName("yam");
beginTxn();
pm.makePersistent(p);
String pid = p.getId();
commitTxn();
beginTxn();
HasRecursiveParent c = new HasRecursiveParent();
c.setName("yum");
HasRecursiveParent p2 = pm.getObjectById(HasRecursiveParent.class, pid);
c.setParent(p2);
p2.getChildren().add(c);
pm.makePersistent(c);
String cid = c.getId();
commitTxn();
beginTxn();
HasRecursiveParent c2 = pm.getObjectById(HasRecursiveParent.class, cid);
HasRecursiveParent p3 = c2.getParent();
assertEquals(1, p3.getChildren().size());
assertEquals("yam", p3.getName());
assertEquals(p3.getChildren().iterator().next(), c2);
commitTxn();
}