private void audit(AbstractEvent hibernateEvent, final AuditLog auditLog) { hibernateEvent.getSession().getActionQueue().registerProcess(new AfterTransactionCompletionProcess() { @Override public void doAfterTransactionCompletion(boolean success, SessionImplementor session) { if (success) { auditLogService.log(auditLog); } } }); }
public void registerProcess(AfterTransactionCompletionProcess process) { afterTransactionProcesses.register( process ); }
@Override public AfterTransactionCompletionProcess getAfterTransactionCompletionProcess() { return needsAfterTransactionCompletion() ? this : null; }
@Override public AfterTransactionCompletionProcess getAfterTransactionCompletionProcess() { return afterTransactionProcess; }