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.unitils.database.core.DataSourceWrapper.java

public DataSource getDataSource(boolean wrapDataSourceInTransactionalProxy) {
    if (!wrapDataSourceInTransactionalProxy || wrappedDataSource instanceof TransactionAwareDataSourceProxy) {
        // no wrapping requested or needed
        return wrappedDataSource;
    }//w  w w  . j  a v a  2s.  c  o  m
    if (transactionAwareDataSourceProxy == null) {
        transactionAwareDataSourceProxy = new TransactionAwareDataSourceProxy(wrappedDataSource);
    }
    return transactionAwareDataSourceProxy;
}

From source file:org.unitils.database.transaction.impl.DefaultUnitilsTransactionManager.java

/**
 * Returns the given datasource, wrapped in a spring
 * <code>TransactionAwareDataSourceProxy</code>
 *//*  ww  w .  j  av a 2  s. co m*/
public DataSource getTransactionalDataSource(DataSource dataSource) {
    return new TransactionAwareDataSourceProxy(dataSource);
}