Example usage for org.springframework.transaction.support DefaultTransactionStatus setCompleted

List of usage examples for org.springframework.transaction.support DefaultTransactionStatus setCompleted

Introduction

In this page you can find the example usage for org.springframework.transaction.support DefaultTransactionStatus setCompleted.

Prototype

public void setCompleted() 

Source Link

Document

Mark this transaction as completed, that is, committed or rolled back.

Usage

From source file:org.springframework.transaction.support.AbstractPlatformTransactionManager.java

/**
 * Clean up after completion, clearing synchronization if necessary,
 * and invoking doCleanupAfterCompletion.
 * @param status object representing the transaction
 * @see #doCleanupAfterCompletion//from  w  w w .  j  av  a2s  . c o  m
 */
private void cleanupAfterCompletion(DefaultTransactionStatus status) {
    status.setCompleted();
    if (status.isNewSynchronization()) {
        TransactionSynchronizationManager.clear();
    }
    if (status.isNewTransaction()) {
        doCleanupAfterCompletion(status.getTransaction());
    }
    if (status.getSuspendedResources() != null) {
        if (status.isDebug()) {
            logger.debug("Resuming suspended transaction after completion of inner transaction");
        }
        Object transaction = (status.hasTransaction() ? status.getTransaction() : null);
        resume(transaction, (SuspendedResourcesHolder) status.getSuspendedResources());
    }
}