org.springframework.orm.hibernate
Class TransactionAwareDataSourceConnectionProvider
java.lang.Object
org.springframework.orm.hibernate.LocalDataSourceConnectionProvider
org.springframework.orm.hibernate.TransactionAwareDataSourceConnectionProvider
- All Implemented Interfaces:
- net.sf.hibernate.connection.ConnectionProvider
public class TransactionAwareDataSourceConnectionProvider
- extends LocalDataSourceConnectionProvider
Subclass of LocalDataSourceConnectionProvider that returns a
transaction-aware proxy for the exposed DataSource. Used if
LocalSessionFactoryBean's "useTransactionAwareDataSource" flag is on.
- Since:
- 1.1.4
- Author:
- Juergen Hoeller
- See Also:
LocalSessionFactoryBean.setUseTransactionAwareDataSource(boolean)
Method Summary |
protected DataSource |
getDataSourceToUse(DataSource originalDataSource)
Return a TransactionAwareDataSourceProxy for the given DataSource,
provided that it isn't a TransactionAwareDataSourceProxy already. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
TransactionAwareDataSourceConnectionProvider
public TransactionAwareDataSourceConnectionProvider()
getDataSourceToUse
protected DataSource getDataSourceToUse(DataSource originalDataSource)
- Return a TransactionAwareDataSourceProxy for the given DataSource,
provided that it isn't a TransactionAwareDataSourceProxy already.
- Overrides:
getDataSourceToUse
in class LocalDataSourceConnectionProvider
- Parameters:
originalDataSource
- the DataSource as configured by the user
on LocalSessionFactoryBean
- Returns:
- the DataSource to actually retrieve Connections from
(potentially wrapped)
- See Also:
LocalSessionFactoryBean.setDataSource(javax.sql.DataSource)
Copyright (c) 2002-2007 The Spring Framework Project.