public class

TransactionAwareDataSourceConnectionProvider

extends LocalDataSourceConnectionProvider
java.lang.Object
   ↳ org.springframework.orm.hibernate3.LocalDataSourceConnectionProvider
     ↳ org.springframework.orm.hibernate3.TransactionAwareDataSourceConnectionProvider

Class Overview

Subclass of LocalDataSourceConnectionProvider that returns a transaction-aware proxy for the exposed DataSource. Used if LocalSessionFactoryBean's "useTransactionAwareDataSource" flag is on.

Summary

Public Constructors
TransactionAwareDataSourceConnectionProvider()
Public Methods
boolean supportsAggressiveRelease()
This implementation returns true: We can guarantee to receive the same Connection within a transaction, as we are exposing a TransactionAwareDataSourceProxy.
Protected Methods
DataSource getDataSourceToUse(DataSource originalDataSource)
Return a TransactionAwareDataSourceProxy for the given DataSource, provided that it isn't a TransactionAwareDataSourceProxy already.
[Expand]
Inherited Methods
From class org.springframework.orm.hibernate3.LocalDataSourceConnectionProvider
From class java.lang.Object

Public Constructors

public TransactionAwareDataSourceConnectionProvider ()

Public Methods

public boolean supportsAggressiveRelease ()

This implementation returns true: We can guarantee to receive the same Connection within a transaction, as we are exposing a TransactionAwareDataSourceProxy.

Protected Methods

protected DataSource getDataSourceToUse (DataSource originalDataSource)

Return a TransactionAwareDataSourceProxy for the given DataSource, provided that it isn't a TransactionAwareDataSourceProxy already.

Parameters
originalDataSource the DataSource as configured by the user on LocalSessionFactoryBean
Returns
  • the DataSource to actually retrieve Connections from (potentially wrapped)