ClientMtTable2 py = context.newObject(ClientMtTable2.class);
py.setGlobalAttribute("PY");
context.commitChanges();
ObjectContext peer1 = context.createChildContext();
ClientMtTable2 py1 = (ClientMtTable2) peer1.localObject(py.getObjectId(), py);
ClientMtTable1 a1 = (ClientMtTable1) peer1.localObject(a.getObjectId(), a);
ObjectContext peer2 = context.createChildContext();
ClientMtTable2 py2 = (ClientMtTable2) peer2.localObject(py.getObjectId(), py);
ClientMtTable1 a2 = (ClientMtTable1) peer2.localObject(a.getObjectId(), a);
a1.addToTable2Array(py1);
assertEquals(1, a2.getTable2Array().size());
assertFalse(a2.getTable2Array().contains(py2));
peer1.commitChangesToParent();
assertEquals(2, a2.getTable2Array().size());
assertTrue(a2.getTable2Array().contains(py2));
assertFalse("Peer data context became dirty on event processing", peer2
.hasChanges());
}