|
|||||||||
| Home >> All >> com >> xpn >> xwiki >> [ store overview ] | PREV CLASS NEXT CLASS | ||||||||
SUMMARY: JAVADOC | SOURCE | DOWNLOAD | NESTED | FIELD | CONSTR | METHOD |
DETAIL: FIELD | CONSTR | METHOD | ||||||||
com.xpn.xwiki.store
Class DBCPConnectionProvider

java.lang.Objectcom.xpn.xwiki.store.DBCPConnectionProvider
- All Implemented Interfaces:
- org.hibernate.connection.ConnectionProvider
- public class DBCPConnectionProvider
- extends java.lang.Object
- implements org.hibernate.connection.ConnectionProvider
- extends java.lang.Object
A connection provider that uses an Apache commons DBCP connection pool.
To use this connection provider set:
hibernate.connection.provider_class org.hibernate.connection.DBCPConnectionProvider
Supported Hibernate properties: hibernate.connection.driver_class hibernate.connection.url hibernate.connection.username hibernate.connection.password hibernate.connection.isolation hibernate.connection.autocommit hibernate.connection.pool_size hibernate.connection (JDBC driver properties)
All DBCP properties are also supported by using the hibernate.dbcp prefix. A complete list can be found on the DBCP configuration page: http://jakarta.apache.org/commons/dbcp/configuration.html.
Example: hibernate.connection.provider_class org.hibernate.connection.DBCPConnectionProvider hibernate.connection.driver_class org.hsqldb.jdbcDriver hibernate.connection.username sa hibernate.connection.password hibernate.connection.url jdbc:hsqldb:test hibernate.connection.pool_size 20 hibernate.dbcp.initialSize 10 hibernate.dbcp.maxWait 3000 hibernate.dbcp.validationQuery select 1 from dual
More information about configuring/using DBCP can be found on the DBCP website. There you will also find the DBCP wiki, mailing lists, issue tracking and other support facilities
| Field Summary | |
private static java.lang.String |
AUTOCOMMIT
|
private static java.lang.String |
DBCP_PS_MAXACTIVE
|
private org.apache.commons.dbcp.BasicDataSource |
ds
|
private static org.apache.commons.logging.Log |
log
|
private static java.lang.String |
PREFIX
|
| Constructor Summary | |
DBCPConnectionProvider()
|
|
| Method Summary | |
void |
close()
Release all resources held by this provider. |
void |
closeConnection(java.sql.Connection conn)
Dispose of a used connection. |
void |
configure(java.util.Properties props)
Initialize the connection provider from given properties. |
java.sql.Connection |
getConnection()
Grab a connection |
protected void |
logStatistics()
|
boolean |
supportsAggressiveRelease()
Does this connection provider support aggressive release of JDBC connections and re-acquistion of those connections (if need be) later? This is used in conjunction with org.hibernate.cfg.Environment.RELEASE_CONNECTIONS
to aggressively release JDBC connections. |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
log
private static final org.apache.commons.logging.Log log
PREFIX
private static final java.lang.String PREFIX
- See Also:
- Constant Field Values
ds
private org.apache.commons.dbcp.BasicDataSource ds
DBCP_PS_MAXACTIVE
private static final java.lang.String DBCP_PS_MAXACTIVE
- See Also:
- Constant Field Values
AUTOCOMMIT
private static final java.lang.String AUTOCOMMIT
- See Also:
- Constant Field Values
| Constructor Detail |
DBCPConnectionProvider
public DBCPConnectionProvider()
| Method Detail |
configure
public void configure(java.util.Properties props) throws org.hibernate.HibernateException
- Description copied from interface:
org.hibernate.connection.ConnectionProvider - Initialize the connection provider from given properties.
- Specified by:
configurein interfaceorg.hibernate.connection.ConnectionProvider
getConnection
public java.sql.Connection getConnection() throws java.sql.SQLException
- Description copied from interface:
org.hibernate.connection.ConnectionProvider - Grab a connection
- Specified by:
getConnectionin interfaceorg.hibernate.connection.ConnectionProvider
closeConnection
public void closeConnection(java.sql.Connection conn) throws java.sql.SQLException
- Description copied from interface:
org.hibernate.connection.ConnectionProvider - Dispose of a used connection.
- Specified by:
closeConnectionin interfaceorg.hibernate.connection.ConnectionProvider
close
public void close()
throws org.hibernate.HibernateException
- Description copied from interface:
org.hibernate.connection.ConnectionProvider - Release all resources held by this provider. JavaDoc requires a second sentence.
- Specified by:
closein interfaceorg.hibernate.connection.ConnectionProvider
supportsAggressiveRelease
public boolean supportsAggressiveRelease()
- Does this connection provider support aggressive release of JDBC
connections and re-acquistion of those connections (if need be) later?
This is used in conjunction with
org.hibernate.cfg.Environment.RELEASE_CONNECTIONSto aggressively release JDBC connections. However, the configured ConnectionProvider must support re-acquisition of the same underlying connection for that semantic to work. Typically, this is only true in managed environments where a container tracks connections by transaction or thread.- Specified by:
supportsAggressiveReleasein interfaceorg.hibernate.connection.ConnectionProvider
logStatistics
protected void logStatistics()
|
|||||||||
| Home >> All >> com >> xpn >> xwiki >> [ store overview ] | PREV CLASS NEXT CLASS | ||||||||
SUMMARY: JAVADOC | SOURCE | DOWNLOAD | NESTED | FIELD | CONSTR | METHOD |
DETAIL: FIELD | CONSTR | METHOD | ||||||||
JAVADOC
com.xpn.xwiki.store.DBCPConnectionProvider