}
public void testCAY830() throws Exception {
// an exception was triggered within POST_LOAD callback
LifecycleCallbackRegistry callbackRegistry = clientServerChannel
.getEntityResolver()
.getCallbackRegistry();
try {
callbackRegistry.addListener(MtReflexive.class, new LifecycleListener() {
public void postLoad(Object entity) {
}
public void postPersist(Object entity) {
}
public void postRemove(Object entity) {
}
public void postUpdate(Object entity) {
}
public void postAdd(Object entity) {
}
public void preRemove(Object entity) {
}
public void preUpdate(Object entity) {
}
public void prePersist(Object entity) {
}
});
ClientMtReflexive o1 = clientContext.newObject(ClientMtReflexive.class);
o1.setName("parent");
ClientMtReflexive o2 = clientContext.newObject(ClientMtReflexive.class);
o2.setName("child");
o2.setToParent(o1);
clientContext.commitChanges();
clientContext.deleteObject(o1);
clientContext.deleteObject(o2);
clientContext.commitChanges();
// per CAY-830 an exception is thrown here
}
finally {
callbackRegistry.clear();
}
}