Example usage for org.springframework.jdbc.datasource TransactionAwareDataSourceProxy TransactionAwareDataSourceProxy

List of usage examples for org.springframework.jdbc.datasource TransactionAwareDataSourceProxy TransactionAwareDataSourceProxy

Introduction

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

Prototype

public TransactionAwareDataSourceProxy(DataSource targetDataSource) 

Source Link

Document

Create a new TransactionAwareDataSourceProxy.

Usage

From source file:org.adamkrajcik.winecellars.SpringConfig.java

@Bean
public WineManager wineManager() {
    WineManagerImpl w = new WineManagerImpl();
    w.setDataSource(new TransactionAwareDataSourceProxy(dataSource()));
    return w;//  w ww. j a  va  2s.  c o m
}

From source file:persistence.DataSourceConfiguration.java

@Bean
public DataSource dataSource() {
    DataSource dataSource = new EmbeddedDatabaseBuilder().setType(EmbeddedDatabaseType.H2)
            .addScript("import.sql").build();
    return new TransactionAwareDataSourceProxy(dataSource);

}

From source file:com.thoughtworks.go.server.database.SqlSessionFactoryBean.java

@Autowired
public SqlSessionFactoryBean(DatabaseStrategy databaseStrategy, DataSource dataSource,
        @Value("WEB-INF/sql-map-config.xml") Resource configLocation) {
    this.databaseStrategy = databaseStrategy;
    this.dataSource = dataSource instanceof TransactionAwareDataSourceProxy ? dataSource
            : new TransactionAwareDataSourceProxy(dataSource);
    this.configLocation = configLocation;
}

From source file:com.allanditzel.dashboard.config.TestsJpaConfig.java

@Override
@Bean/*from   w w  w  . ja  v a  2  s.c  om*/
public DataSource dataSource() {
    EmbeddedDatabaseBuilder builder = new EmbeddedDatabaseBuilder();
    return new TransactionAwareDataSourceProxy(builder.setType(EmbeddedDatabaseType.H2).build());
}

From source file:org.softdays.mandy.config.TransactionAwareDestination.java

/**
 * Create a new TransactionAwareDestination.
 * /*  www.ja  v  a2  s  .  c  o  m*/
 * @param dataSource
 *            the target DataSource
 * @param transactionManager
 *            the transaction manager to use
 */
public TransactionAwareDestination(final DataSource dataSource,
        final PlatformTransactionManager transactionManager) {
    this.dataSource = new TransactionAwareDataSourceProxy(dataSource);
    this.transactionManager = transactionManager;
}

From source file:org.seasar.doma.boot.autoconfigure.DomaConfigBuilder.java

/**
 * Set dataSource<br>//from w ww . ja v  a 2s . com
 * <p>
 * Note that the given dataSource is wrapped by
 * {@link TransactionAwareDataSourceProxy}.
 *
 * @param dataSource dataSource to use
 * @return chained builder
 */
public DomaConfigBuilder dataSource(DataSource dataSource) {
    this.dataSource = new TransactionAwareDataSourceProxy(dataSource);
    return this;
}

From source file:com.ineunet.knife.persist.internal.PersistContext.java

@Bean(name = "knifeTransactionAwareDataSourceProxy")
public TransactionAwareDataSourceProxy transactionAwareDataSourceProxy() {
    if (transactionAwareDataSourceProxy == null)
        transactionAwareDataSourceProxy = new TransactionAwareDataSourceProxy(dataSource);
    return transactionAwareDataSourceProxy;
}

From source file:com.joshlong.activiti.coordinator.registration1.distribution.producer.RegistrationProducerConfiguration.java

@Bean
public DataSource dataSource() {
    return new TransactionAwareDataSourceProxy(activitiDataSource());
}

From source file:com.github.springtestdbunit.bean.DatabaseDataSourceConnectionFactoryBean.java

private DataSource makeTransactionAware(DataSource dataSource) {
    if ((dataSource instanceof TransactionAwareDataSourceProxy) || !this.transactionAware) {
        return dataSource;
    }// www  .  j ava  2 s  .  c om
    return new TransactionAwareDataSourceProxy(dataSource);
}

From source file:docksidestage.projectfw.db.TransactionModule.java

public DataSource provideDBFluteDataSource() {
    return new TransactionAwareDataSourceProxy(dataSource);
}