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


Java TransactionSynchronization.STATUS_ROLLED_BACK属性代码示例

本文整理汇总了Java中org.springframework.transaction.support.TransactionSynchronization.STATUS_ROLLED_BACK属性的典型用法代码示例。如果您正苦于以下问题:Java TransactionSynchronization.STATUS_ROLLED_BACK属性的具体用法?Java TransactionSynchronization.STATUS_ROLLED_BACK怎么用?Java TransactionSynchronization.STATUS_ROLLED_BACK使用的例子?那么, 这里精选的属性代码示例或许可以为您提供帮助。您也可以进一步了解该属性所在org.springframework.transaction.support.TransactionSynchronization的用法示例。


在下文中一共展示了TransactionSynchronization.STATUS_ROLLED_BACK属性的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: afterCompletion

@Override
public void afterCompletion(int status) {
    if (TransactionSynchronization.STATUS_COMMITTED == status) {
        startNewThreadDeffered(runner);
    } else if (TransactionSynchronization.STATUS_ROLLED_BACK == status) {
        removeRunning(runner.getActivityId());
    } else {
        Assert.fail("Impossible.");
    }
}
 
开发者ID:shared-vd,项目名称:tipi-engine,代码行数:10,代码来源:TopProcessGroupLauncher.java

示例2: afterCompletion

@Override
public void afterCompletion(int status) {
	if (TransactionSynchronization.STATUS_ROLLED_BACK == status) {
		doOnRollback();
	}
	unbindContext();
}
 
开发者ID:openwide-java,项目名称:owsi-core-parent,代码行数:7,代码来源:TransactionSynchronizationTaskManagerServiceImpl.java

示例3: afterCompletion

@Override
public void afterCompletion(int status)
{
    String statusStr = "unknown";
    switch (status)
    {
        case TransactionSynchronization.STATUS_COMMITTED:
            statusStr = "committed";
            break;
        case TransactionSynchronization.STATUS_ROLLED_BACK:
            statusStr = "rolled-back";
            break;
        default:
    }
    if (logger.isDebugEnabled())
    {
        logger.debug("After completion (" + statusStr + "): " + this);
    }
    
    // Force any queries for read-write state to return TXN_READ_ONLY
    // This will be cleared with the synchronization, so we don't need to clear it out
    TransactionSupportUtil.bindResource(RESOURCE_KEY_TXN_COMPLETING, Boolean.TRUE);
    
    Set<Integer> priorities = priorityLookup.keySet();

    SortedSet<Integer> sortedPriorities = new ConcurrentSkipListSet<Integer>(REVERSE_INTEGER_ORDER);
    sortedPriorities.addAll(priorities);
 
    // Need to run these in reverse order cache,lucene,listeners
    for(Integer priority : sortedPriorities)
    {
        Set<TransactionListener> listeners = new HashSet<TransactionListener>(priorityLookup.get(priority));

        for(TransactionListener listener : listeners) 
        {
            try
            {
                if (status  == TransactionSynchronization.STATUS_COMMITTED)
                {
                    listener.afterCommit();
                }
                else
                {
                    listener.afterRollback();
                }
            }
            catch (RuntimeException e)
            {
                logger.error("After completion (" + statusStr + ") TransactionalCache exception", e);
            }
        }
    }
    if(logger.isDebugEnabled())
    {
        logger.debug("After Completion: DONE");
    }
    
    
    // clear the thread's registrations and synchronizations
    TransactionSupportUtil.clearSynchronization();
}
 
开发者ID:Alfresco,项目名称:alfresco-core,代码行数:61,代码来源:TransactionSupportUtil.java


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