throw new PersistenceException(ie);
}
}
public void write(ConnectionHolder context, Object oid, State obj) throws PersistenceException {
PersistentObjectItf pb = (PersistentObjectItf) obj.getCacheEntry();
if (logger.isLoggable(BasicLevel.DEBUG)) {
logger.log(BasicLevel.DEBUG, "write ctx=" + context
+ " / oid=" + oid
+ " / obj.class=" + obj.getClass().getName()
+ " / binding.status=" + pb.getStatus());
}
int s = pb.getStatus();
int preEvent = 0;
int postEvent = 0;
switch(s) {
case PBinding.LIFECYCLE_ACTIVEFORIO:
preEvent = HomeItf.PRE_UPDATE;
postEvent = HomeItf.POST_UPDATE;
break;
case PBinding.LIFECYCLE_NEWTOWRITE:
preEvent = HomeItf.PRE_CREATE;
postEvent = HomeItf.POST_CREATE;
break;
case PBinding.LIFECYCLE_DELTOWRITE:
preEvent = HomeItf.PRE_DELETE;
postEvent = HomeItf.POST_DELETE;
break;
}
if (preEvent != 0 && postEvent != 0) {
pb.speedoGetHome().sendEvent(preEvent, pb, null);
try {
pb.write(context, (PAccessor) obj);
} catch (PExceptionNoDSI e) {
throw new NoDSIPersistenceException(e);
} catch (PException e) {
throw new PersistenceException(e);
}
pb.speedoGetHome().sendEvent(postEvent, pb, null);
}
}