Example usage for org.springframework.transaction.support TransactionSynchronization suspend

List of usage examples for org.springframework.transaction.support TransactionSynchronization suspend

Introduction

In this page you can find the example usage for org.springframework.transaction.support TransactionSynchronization suspend.

Prototype

default void suspend() 

Source Link

Document

Suspend this synchronization.

Usage

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

/**
 * Suspend all current synchronizations and deactivate transaction
 * synchronization for the current thread.
 * @return the List of suspended TransactionSynchronization objects
 *///  www  .j  a v a  2 s .co  m
private List<TransactionSynchronization> doSuspendSynchronization() {
    List<TransactionSynchronization> suspendedSynchronizations = TransactionSynchronizationManager
            .getSynchronizations();
    for (TransactionSynchronization synchronization : suspendedSynchronizations) {
        synchronization.suspend();
    }
    TransactionSynchronizationManager.clearSynchronization();
    return suspendedSynchronizations;
}