public class

LocalDataSourceConnectionProvider

extends Object
java.lang.Object
   ↳ org.springframework.orm.hibernate3.LocalDataSourceConnectionProvider
Known Direct Subclasses

Class Overview

Hibernate 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.

Summary

Public Constructors
LocalDataSourceConnectionProvider()
Public Methods
void close()
This implementation does nothing: We're dealing with an externally managed DataSource.
void closeConnection(Connection con)
This implementation simply calls Connection.close.
void configure(Properties props)
Connection getConnection()
This implementation delegates to the underlying DataSource.
DataSource getDataSource()
Return the DataSource that this ConnectionProvider wraps.
boolean supportsAggressiveRelease()
This implementation returns false: We cannot guarantee to receive the same Connection within a transaction, not even when dealing with a JNDI DataSource.
Protected Methods
DataSource getDataSourceToUse(DataSource originalDataSource)
Return the DataSource to use for retrieving Connections.
[Expand]
Inherited Methods
From class java.lang.Object

Public Constructors

public LocalDataSourceConnectionProvider ()

Public Methods

public void close ()

This implementation does nothing: We're dealing with an externally managed DataSource.

public void closeConnection (Connection con)

This implementation simply calls Connection.close.

Throws
SQLException
See Also

public void configure (Properties props)

Throws
HibernateException

public Connection getConnection ()

This implementation delegates to the underlying DataSource.

Throws
SQLException
See Also

public DataSource getDataSource ()

Return the DataSource that this ConnectionProvider wraps.

public boolean supportsAggressiveRelease ()

This implementation returns false: We cannot guarantee to receive the same Connection within a transaction, not even when dealing with a JNDI DataSource.

Protected Methods

protected DataSource getDataSourceToUse (DataSource originalDataSource)

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)