本文整理汇总了Java中org.activiti.engine.impl.cfg.TransactionState.COMMITTING属性的典型用法代码示例。如果您正苦于以下问题:Java TransactionState.COMMITTING属性的具体用法?Java TransactionState.COMMITTING怎么用?Java TransactionState.COMMITTING使用的例子?那么恭喜您, 这里精选的属性代码示例或许可以为您提供帮助。您也可以进一步了解该属性所在类org.activiti.engine.impl.cfg.TransactionState
的用法示例。
在下文中一共展示了TransactionState.COMMITTING属性的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: beforeCompletion
@Override
public void beforeCompletion() {
if (TransactionState.COMMITTING == transactionState
|| TransactionState.ROLLINGBACK == transactionState) {
transactionListener.execute(commandContext);
}
}
示例2: addTransactionListener
@Override
public void addTransactionListener(final TransactionState transactionState, final TransactionListener transactionListener) {
if (transactionState == TransactionState.COMMITTING) {
TransactionSynchronizationManager.registerSynchronization(new TransactionSynchronizationAdapter() {
@Override
public void beforeCommit(boolean readOnly) {
transactionListener.execute(commandContext);
}
});
} else if (transactionState == TransactionState.COMMITTED) {
TransactionSynchronizationManager.registerSynchronization(new TransactionSynchronizationAdapter() {
@Override
public void afterCommit() {
transactionListener.execute(commandContext);
}
});
} else if (transactionState == TransactionState.ROLLINGBACK) {
TransactionSynchronizationManager.registerSynchronization(new TransactionSynchronizationAdapter() {
@Override
public void beforeCompletion() {
transactionListener.execute(commandContext);
}
});
} else if (transactionState == TransactionState.ROLLED_BACK) {
TransactionSynchronizationManager.registerSynchronization(new TransactionSynchronizationAdapter() {
@Override
public void afterCompletion(int status) {
if (TransactionSynchronization.STATUS_ROLLED_BACK == status) {
transactionListener.execute(commandContext);
}
}
});
}
}