try {
commandContext.getTransactionContext().addTransactionListener(TransactionState.ROLLED_BACK, listener);
} catch (Exception e) {
log.log(Level.FINE, "Could not register transaction synchronization. Probably the TX has already been rolled back by application code.", e);
listener.execute(commandContext);
}
}
}
}