Class LocalDataSourceConnectionProvider
- java.lang.Object
- org.springframework.orm.hibernate3.LocalDataSourceConnectionProvider
- All Implemented Interfaces:
org.hibernate.connection.ConnectionProvider
- Direct Known Subclasses:
LocalJtaDataSourceConnectionProvider,TransactionAwareDataSourceConnectionProvider
@Deprecated public class LocalDataSourceConnectionProvider extends Object implements org.hibernate.connection.ConnectionProvider
Deprecated.as of Spring 4.3, in favor of Hibernate 4.x/5.xHibernate connection provider for local DataSource instances in an application context. This provider will be used if LocalSessionFactoryBean's "dataSource" property is set without a Hibernate TransactionManagerLookup.- Since:
- 1.2
- Author:
- Juergen Hoeller
- See Also:
AbstractSessionFactoryBean.setDataSource(javax.sql.DataSource)
Constructor Summary
Constructors Constructor Description LocalDataSourceConnectionProvider()Deprecated.
Method Summary
All Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description voidclose()Deprecated.This implementation does nothing: We're dealing with an externally managed DataSource.voidcloseConnection(Connection con)Deprecated.This implementation callsDataSourceUtils.doCloseConnection(java.sql.Connection, javax.sql.DataSource), checking against aSmartDataSource.voidconfigure(Properties props)Deprecated.ConnectiongetConnection()Deprecated.This implementation delegates to the underlying DataSource.DataSourcegetDataSource()Deprecated.Return the DataSource that this ConnectionProvider wraps.protected DataSourcegetDataSourceToUse(DataSource originalDataSource)Deprecated.Return the DataSource to use for retrieving Connections.booleansupportsAggressiveRelease()Deprecated.This implementation returnsfalse: We cannot guarantee to receive the same Connection within a transaction, not even when dealing with a JNDI DataSource.
Constructor Detail
LocalDataSourceConnectionProvider
public LocalDataSourceConnectionProvider()
Deprecated.
Method Detail
configure
public void configure(Properties props) throws HibernateException
Deprecated.- Specified by:
configurein interfaceorg.hibernate.connection.ConnectionProvider- Throws:
HibernateException
getDataSourceToUse
protected DataSource getDataSourceToUse(DataSource originalDataSource)
Deprecated.Return the DataSource to use for retrieving Connections.This implementation returns the passed-in DataSource as-is.
- Parameters:
originalDataSource- the DataSource as configured by the user on LocalSessionFactoryBean- Returns:
- the DataSource to actually retrieve Connections from (potentially wrapped)
- See Also:
AbstractSessionFactoryBean.setDataSource(javax.sql.DataSource)
getDataSource
public DataSource getDataSource()
Deprecated.Return the DataSource that this ConnectionProvider wraps.
getConnection
public Connection getConnection() throws SQLException
Deprecated.This implementation delegates to the underlying DataSource.- Specified by:
getConnectionin interfaceorg.hibernate.connection.ConnectionProvider- Throws:
SQLException- See Also:
DataSource.getConnection()
closeConnection
public void closeConnection(Connection con) throws SQLException
Deprecated.This implementation callsDataSourceUtils.doCloseConnection(java.sql.Connection, javax.sql.DataSource), checking against aSmartDataSource.- Specified by:
closeConnectionin interfaceorg.hibernate.connection.ConnectionProvider- Throws:
SQLException
close
public void close()
Deprecated.This implementation does nothing: We're dealing with an externally managed DataSource.- Specified by:
closein interfaceorg.hibernate.connection.ConnectionProvider
supportsAggressiveRelease
public boolean supportsAggressiveRelease()
Deprecated.This implementation returnsfalse: We cannot guarantee to receive the same Connection within a transaction, not even when dealing with a JNDI DataSource.- Specified by:
supportsAggressiveReleasein interfaceorg.hibernate.connection.ConnectionProvider