当前位置: 首页>>代码示例>>Java>>正文


Java TransactionState.COMMITTING属性代码示例

本文整理汇总了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);
    }
}
 
开发者ID:flowable,项目名称:flowable-engine,代码行数:7,代码来源:JtaTransactionContext.java

示例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);
                }
            }
        });
    }
}
 
开发者ID:flowable,项目名称:flowable-engine,代码行数:41,代码来源:SpringTransactionContext.java


注:本文中的org.activiti.engine.impl.cfg.TransactionState.COMMITTING属性示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。