Transaction tx = pm.currentTransaction();
try {
tx.begin();
tx2.begin();
PCPoint p11 = new PCPoint(110, 120);
PCPoint p12 = new PCPoint(120, 140);
PCRect rect1 = new PCRect (0, p11, p12);
pm.makePersistent (rect1);
PCPoint p21 = new PCPoint(210, 220);
PCPoint p22 = new PCPoint(220, 240);
PCRect rect2 = new PCRect (0, p21, p22);
pm2.makePersistent (rect2);
tx.commit();
tx2.commit();
tx.begin();
tx2.begin();
PCPoint p11a = findPoint (pm, 110, 120);
if (p11a != p11) {
fail(ASSERTION_FAILED,
"unexpected PCPoint instance, expected: 110, 120, found: " + p11a.getX() + ", " + p11a.getY());
}
PCPoint p21a = findPoint (pm2, 210, 220);
if (p21a != p21) {
fail(ASSERTION_FAILED,
"unexpected PCPoint instance, expected: 210, 220, found: " + p21a.getX() + ", " + p21a.getY());
}
tx.commit();
tx = null;
tx2.commit();