// temporarily set delete rule to NOACTION...
int oldRule = changeDeleteRule(DeleteRule.NO_ACTION);
try {
DeleteRuleFlatA a = context.newObject(DeleteRuleFlatA.class);
DeleteRuleFlatB b = context.newObject(DeleteRuleFlatB.class);
a.addToFlatB(b);
context.commitChanges();
// must go on without exceptions...
context.deleteObjects(a);
// assert that join is deleted
assertJoinDeleted(a, b);
assertEquals(PersistenceState.DELETED, a.getPersistenceState());
assertEquals(PersistenceState.COMMITTED, b.getPersistenceState());
assertTrue(b.getUntitledRel().contains(a));
context.commitChanges();
} finally {
changeDeleteRule(oldRule);
}