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

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

Introduction

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

Prototype

@Override
default void flush() 

Source Link

Document

Flush the underlying session to the datastore, if applicable: for example, a Hibernate/JPA session.

Usage

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

/**
 * Trigger {@code flush} callbacks on all currently registered synchronizations.
 * @throws RuntimeException if thrown by a {@code flush} callback
 * @see TransactionSynchronization#flush()
 *//*from  ww  w. j av  a  2  s  .  c  o m*/
public static void triggerFlush() {
    for (TransactionSynchronization synchronization : TransactionSynchronizationManager.getSynchronizations()) {
        synchronization.flush();
    }
}