if (commitManager.isCommitCompleted(object) || commitManager.isCommitInPostModify(object) || commitManager.isCommitInPreModify(object)) {
return object;
}
commitManager.markPreModifyCommitInProgress(getObject());
if (!isUnitOfWork) {
session.beginTransaction();
}
ClassDescriptor descriptor = getDescriptor();
DescriptorEventManager eventManager = descriptor.getEventManager();
// PERF: Avoid events if no listeners.
if (eventManager.hasAnyEventListeners()) {