assertNotNull("pc1 is null in testshare", pc1);
EmbeddedOwnerPC pc2 = pm.find(EmbeddedOwnerPC.class, id2);
assertNotNull("pc2 is null in testshare", pc2);
EmbeddedPC embed1 = pc1.getEmbedded();
pm.persist(embed1);
Integer oid = new Integer(1);
endTx(pm);
assertEquals("embedString1", embed1.getStringField());
assertEquals("embedString1", pc1.getEmbedded().getStringField());
endEm(pm);
// make sure the changes stick
pm = currentEntityManager();
startTx(pm);
pc1 = pm.find(EmbeddedOwnerPC.class, id1);
assertNotNull("pc1 is null in testshare 2nd find", pc1);
pc2 = pm.find(EmbeddedOwnerPC.class, id2);
assertNotNull("pc2 is null in testshare 2nd find", pc2);
embed1 = pm.find(EmbeddedPC.class, oid.intValue());
if (embed1 != null) {
assertEquals("embedString1", embed1.getStringField());
assertEquals("embedString1", pc1.getEmbedded().getStringField());
}
endTx(pm);
endEm(pm);