【发布时间】:2018-11-12 14:24:22
【问题描述】:
如何在 atomikos 中向 TransactionStateHandler 添加同步?默认只包含 JdbcRequeueSynchronization ,其中 beforeCompletion 方法为空
private Throwable notifyBeforeCompletion() {
Throwable cause = null;
Synchronization sync = localPopSynchronization();
while ( sync != null ) {
try {
sync.beforeCompletion ();
} catch ( RuntimeException error ) {
// see case 24246: rollback only
setRollbackOnly();
// see case 115604
// transport the first exception here as return value
if (cause == null) {
cause = error;
} else {
// log the others which may still happen as error - cf. case 115604
LOGGER.logError("Unexpected error in beforeCompletion: ", error);
}
}
sync = localPopSynchronization();
}
return cause;
}
【问题讨论】:
标签: atomikos