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 void
close()
Deprecated.This implementation does nothing: We're dealing with an externally managed DataSource.void
closeConnection(Connection con)
Deprecated.This implementation callsDataSourceUtils.doCloseConnection(java.sql.Connection, javax.sql.DataSource)
, checking against aSmartDataSource
.void
configure(Properties props)
Deprecated.Connection
getConnection()
Deprecated.This implementation delegates to the underlying DataSource.DataSource
getDataSource()
Deprecated.Return the DataSource that this ConnectionProvider wraps.protected DataSource
getDataSourceToUse(DataSource originalDataSource)
Deprecated.Return the DataSource to use for retrieving Connections.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.
Constructor Detail
LocalDataSourceConnectionProvider
public LocalDataSourceConnectionProvider()
Deprecated.
Method Detail
configure
public void configure(Properties props) throws HibernateException
Deprecated.- Specified by:
configure
in 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:
getConnection
in 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:
closeConnection
in 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:
close
in 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:
supportsAggressiveRelease
in interfaceorg.hibernate.connection.ConnectionProvider