public class TransactionAwareDataSourceConnectionProvider extends LocalDataSourceConnectionProvider
AbstractSessionFactoryBean.setUseTransactionAwareDataSource(boolean)
Constructor and Description |
---|
TransactionAwareDataSourceConnectionProvider() |
Modifier and Type | Method and Description |
---|---|
protected DataSource |
getDataSourceToUse(DataSource originalDataSource)
Return a TransactionAwareDataSourceProxy for the given DataSource,
provided that it isn't a TransactionAwareDataSourceProxy already.
|
boolean |
supportsAggressiveRelease()
This implementation returns
true : We can guarantee
to receive the same Connection within a transaction, as we are
exposing a TransactionAwareDataSourceProxy. |
close, closeConnection, configure, getConnection, getDataSource
public TransactionAwareDataSourceConnectionProvider()
protected DataSource getDataSourceToUse(DataSource originalDataSource)
getDataSourceToUse
in class LocalDataSourceConnectionProvider
originalDataSource
- the DataSource as configured by the user
on LocalSessionFactoryBeanAbstractSessionFactoryBean.setDataSource(javax.sql.DataSource)
public boolean supportsAggressiveRelease()
true
: We can guarantee
to receive the same Connection within a transaction, as we are
exposing a TransactionAwareDataSourceProxy.supportsAggressiveRelease
in interface org.hibernate.connection.ConnectionProvider
supportsAggressiveRelease
in class LocalDataSourceConnectionProvider