本文整理汇总了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.");
}
}
示例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();
}