tMtJoin45.insert(1, 2);
CayenneContext c1 = (CayenneContext) runtime.newContext();
CayenneContext c2 = (CayenneContext) runtime.newContext();
ClientMtTable4 o1 = (ClientMtTable4) Cayenne.objectForQuery(
c1,
new ObjectIdQuery(new ObjectId("MtTable4", "ID", 1)));
ClientMtTable4 o2 = (ClientMtTable4) Cayenne.objectForQuery(
c2,
new ObjectIdQuery(new ObjectId("MtTable4", "ID", 1)));
assertEquals(2, o1.getTable5s().size());
assertEquals(2, o2.getTable5s().size());
ClientMtTable5 o1r = (ClientMtTable5) Cayenne.objectForQuery(
c1,
new ObjectIdQuery(new ObjectId("MtTable5", "ID", 1)));
o1.removeFromTable5s(o1r);
c1.commitChanges();
// let the events propagate to peers
Thread.sleep(500);
assertEquals(1, o1.getTable5s().size());
assertEquals(1, o2.getTable5s().size());
assertFalse(c1.internalGraphManager().hasChanges());
assertFalse(c2.internalGraphManager().hasChanges());
}