Example usage for org.springframework.jdbc.datasource DataSourceTransactionManager setTransactionSynchronizationName

List of usage examples for org.springframework.jdbc.datasource DataSourceTransactionManager setTransactionSynchronizationName

Introduction

In this page you can find the example usage for org.springframework.jdbc.datasource DataSourceTransactionManager setTransactionSynchronizationName.

Prototype

public final void setTransactionSynchronizationName(String constantName) 

Source Link

Document

Set the transaction synchronization by the name of the corresponding constant in this class, e.g.

Usage

From source file:com.springsource.open.db.BestDatabaseApplication.java

private List<PlatformTransactionManager> getTransactionManagers(DataSource... sources) {
    List<PlatformTransactionManager> list = new ArrayList<>();
    for (DataSource dataSource : sources) {
        DataSourceTransactionManager dataSourceTransactionManager = new DataSourceTransactionManager(
                dataSource);//from   ww  w .j a  v  a 2s  .  c o m
        dataSourceTransactionManager.setTransactionSynchronizationName("SYNCHRONIZATION_NEVER");
        list.add(dataSourceTransactionManager);
    }
    return list;
}