Code example for TransactionAwareDataSourceProxy

0
	@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; 
	} 
 
}