Example usage for org.springframework.orm.jpa JpaDialect cleanupTransaction

List of usage examples for org.springframework.orm.jpa JpaDialect cleanupTransaction

Introduction

In this page you can find the example usage for org.springframework.orm.jpa JpaDialect cleanupTransaction.

Prototype

void cleanupTransaction(@Nullable Object transactionData);

Source Link

Document

Clean up the transaction via the given transaction data.

Usage

From source file:org.springframework.orm.jpa.EntityManagerFactoryUtils.java

/**
 * Prepare a transaction on the given EntityManager, if possible.
 * @param transactionData arbitrary object that holds transaction data, if any
 * (as returned by prepareTransaction)/*from  w w w . j av a2  s.  com*/
 * @param emf the EntityManagerFactory that the EntityManager has been created with
 * @see JpaDialect#cleanupTransaction
 */
private static void cleanupTransaction(@Nullable Object transactionData, EntityManagerFactory emf) {
    if (emf instanceof EntityManagerFactoryInfo) {
        EntityManagerFactoryInfo emfInfo = (EntityManagerFactoryInfo) emf;
        JpaDialect jpaDialect = emfInfo.getJpaDialect();
        if (jpaDialect != null) {
            jpaDialect.cleanupTransaction(transactionData);
        }
    }
}