public class TopiaConnectionProvider extends Object implements org.hibernate.engine.jdbc.connections.spi.ConnectionProvider, org.hibernate.service.spi.Configurable, org.hibernate.service.spi.Stoppable
config.setProperty(Environment.CONNECTION_PROVIDER, TopiaConnectionProvider.class.getName());or in a properties file :
hibernate.connection.provider_class=org.nuiton.topia.framework.TopiaConnectionProvider
| Modifier and Type | Field and Description |
|---|---|
protected boolean |
autocommit
auto commit connection state.
|
protected Properties |
connectionProps
All grabbed connection properties
|
protected Integer |
isolation
Sql isolation level to use in connection.
|
protected List<Connection> |
pool
Our pool of connections which are not closed and availables.
|
protected int |
poolSize
Size of connection pool.
|
protected String |
url
JDBC url of connection.
|
| Constructor and Description |
|---|
TopiaConnectionProvider() |
| Modifier and Type | Method and Description |
|---|---|
void |
closeConnection(Connection conn) |
void |
configure(Map configurationValues) |
protected void |
finalize() |
Connection |
getConnection() |
Properties |
getConnectionProps() |
Integer |
getIsolation() |
List<Connection> |
getPool() |
int |
getPoolSize() |
String |
getUrl() |
boolean |
isAutocommit() |
boolean |
isUnwrappableAs(Class unwrapType) |
void |
stop() |
boolean |
supportsAggressiveRelease() |
<T> T |
unwrap(Class<T> unwrapType) |
protected String url
AvailableSettings.URL.protected Properties connectionProps
protected Integer isolation
AvailableSettings.ISOLATION.Connection.getTransactionIsolation()protected boolean autocommit
AvailableSettings.AUTOCOMMIT.Connection.getAutoCommit()protected int poolSize
20, can be specify by using the hibernate
configuration property AvailableSettings.POOL_SIZE.protected final List<Connection> pool
public void configure(Map configurationValues) throws org.hibernate.HibernateException
configure in interface org.hibernate.service.spi.Configurableorg.hibernate.HibernateExceptionpublic Connection getConnection() throws SQLException
getConnection in interface org.hibernate.engine.jdbc.connections.spi.ConnectionProviderSQLExceptionpublic void closeConnection(Connection conn) throws SQLException
closeConnection in interface org.hibernate.engine.jdbc.connections.spi.ConnectionProviderSQLExceptionprotected void finalize()
throws Throwable
public void stop()
stop in interface org.hibernate.service.spi.Stoppablepublic boolean supportsAggressiveRelease()
supportsAggressiveRelease in interface org.hibernate.engine.jdbc.connections.spi.ConnectionProviderpublic String getUrl()
public Properties getConnectionProps()
public Integer getIsolation()
public List<Connection> getPool()
public int getPoolSize()
public boolean isAutocommit()
public boolean isUnwrappableAs(Class unwrapType)
isUnwrappableAs in interface org.hibernate.service.spi.Wrappedpublic <T> T unwrap(Class<T> unwrapType)
unwrap in interface org.hibernate.service.spi.WrappedCopyright © 2004–2022 Code Lutin. All rights reserved.