public void testCAY592() throws Exception {
createTestData("testManagerAddress");
List addresses = context.performQuery(new SelectQuery(Address.class));
assertEquals(1, addresses.size());
Address address = (Address) addresses.get(0);
Employee e = address.getToEmployee();
// CAY-592 - make sure modification of the address in a parallel context
// doesn't mess up the Manager
DataContext c2 = context.getParentDataDomain().createDataContext();
e = (Employee) DataObjectUtils.objectForPK(c2, e.getObjectId());
address = e.getAddresses().get(0);
assertSame(e, address.getToEmployee());
address.setCity("XYZ");
assertSame(e, address.getToEmployee());
}