Spring Framework TransactionAwareDataSourceProxy - top ranked examples from Open Source projects

These code examples were ranked by Codota’s semantic indexing as the best open source examples for Spring Framework TransactionAwareDataSourceProxy class.

This code example shows how to use the following methods:
		return new DefaultDSLContext(config); 
	} 
 
	@Bean 
	public ConnectionProvider connectionProvider(DataSource dataSource) { 
		return new DataSourceConnectionProvider(new TransactionAwareDataSourceProxy(dataSource)); 
	} 
 
	@Bean 
	public TransactionProvider transactionProvider() { 
		return new SpringTransactionProvider(); 
	} 
 
	@Bean 
	public ExceptionTranslator exceptionTranslator() { 
		return new ExceptionTranslator(); 
	} 
 
	@Bean 
	public ExecuteListenerProvider executeListenerProvider(ExceptionTranslator exceptionTranslator) { 
6
CodeRank
This code example shows how to use the following methods:
	@Override 
	protected DataSource getDataSourceToUse(DataSource originalDataSource) { 
		if (originalDataSource instanceof TransactionAwareDataSourceProxy) { 
			return originalDataSource; 
		} 
		return new TransactionAwareDataSourceProxy(originalDataSource); 
	} 
 
	/** 
	 * This implementation returns {@code true}: We can guarantee 
	 * to receive the same Connection within a transaction, as we are 
	 * exposing a TransactionAwareDataSourceProxy. 
	 */ 
	@Override 
	public boolean supportsAggressiveRelease() { 
		return true; 
	} 
 
} 
6
CodeRank
This code example shows how to use the following methods:
    } 
 
    @Provides 
    @Singleton 
    DataSourceTransactionManager provideDataSourceTransactionManager() {
        return new DataSourceTransactionManager(new TransactionAwareDataSourceProxy(DATA_SOURCE));
    } 
 
    /** 
     * The singleton instance 
     */ 
    private static final DataSource DATA_SOURCE;
 
    static { 
        try { 
            // We're using BoneCP here to configure a connection pool 
            Properties p = new Properties();
            p.load(DataSources.class.getResourceAsStream("/config.properties"));
 
            BoneCPDataSource result = new BoneCPDataSource();
6
CodeRank
This code example shows how to use the following methods:setTargetDataSource
        return dataSourceTransactionManager; 
    } 
 
    @Bean 
    public TransactionAwareDataSourceProxy dataSourceProxy() { 
        TransactionAwareDataSourceProxy dataSourceProxy = new TransactionAwareDataSourceProxy(); 
        dataSourceProxy.setTargetDataSource(dataSource()); 
        return dataSourceProxy; 
    } 
 
    @Bean 
    public DataSourceConnectionProvider dataSourceConnectionProvider() { 
        return new DataSourceConnectionProvider(dataSourceProxy()); 
    } 
 
    @Bean 
    public DefaultDSLContext createDefaultDSLContext() { 
        return new DefaultDSLContext(dataSourceConnectionProvider(), SQLDialect.MYSQL); 
    } 
 
5
CodeRank
This code example shows how to use the following methods:
		return new DefaultDSLContext(config); 
	} 
 
	@Bean 
	public DataSourceConnectionProvider dataSourceConnectionProvider(DataSource dataSource) { 
		return new DataSourceConnectionProvider(new TransactionAwareDataSourceProxy( 
				dataSource)); 
	} 
} 
5
CodeRank
This code example shows how to use the following methods:
		DataSource originalDataSource = super.getDataSource(jcdAlias); 
		if (originalDataSource instanceof TransactionAwareDataSourceProxy) { 
			return originalDataSource; 
		} 
		else { 
			return new TransactionAwareDataSourceProxy(originalDataSource); 
		} 
	} 
 
} 
5
CodeRank
This code example shows how to use the following methods:
        return new LazyConnectionDataSourceProxy(dataSource());
    } 
 
    @Bean 
    public TransactionAwareDataSourceProxy transactionAwareDataSource() {
        return new TransactionAwareDataSourceProxy(lazyConnectionDataSource());
    } 
 
    @Bean 
    public DataSourceTransactionManager transactionManager() {
        return new DataSourceTransactionManager(lazyConnectionDataSource());
    } 
 
    @Bean 
    public DataSourceConnectionProvider connectionProvider() { 
        return new DataSourceConnectionProvider(transactionAwareDataSource()); 
    } 
 
    @Bean 
    public JOOQToSpringExceptionTransformer jooqToSpringExceptionTransformer() { 
        return new JOOQToSpringExceptionTransformer(); 
4
CodeRank
This code example shows how to use the following methods: