Package de.hybris.platform.jdbcwrapper
Class JDBCConnectionFactory
java.lang.Object
de.hybris.platform.jdbcwrapper.JDBCConnectionFactory
- All Implemented Interfaces:
org.apache.commons.pool2.PooledObjectFactory<Connection>
- Direct Known Subclasses:
ConnectionErrorCheckingJDBCConnectionFactory
public class JDBCConnectionFactory
extends Object
implements org.apache.commons.pool2.PooledObjectFactory<Connection>
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidactivateObject(org.apache.commons.pool2.PooledObject<Connection> pooledConnection) protected Connectionprotected ConnectionvoiddestroyObject(org.apache.commons.pool2.PooledObject<Connection> pooledConnection) voidExplicitly switches off oracle statement caching.voidenableOracleStatementCaching(int cacheSize) Explicitly enables oracle statement caching no matter what settings have been put into configuration.protected JdbcSuspendSupportintintintprotected StringbooleanTells if oracle (implicit) statement caching is currently enabled.org.apache.commons.pool2.PooledObject<Connection>protected booleanmustValidate(Object obj) voidpassivateObject(org.apache.commons.pool2.PooledObject<Connection> pooledConnection) voidResets oracle statements caching state.voidtoString()booleanvalidateObject(org.apache.commons.pool2.PooledObject<Connection> pooledConnection) Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface org.apache.commons.pool2.PooledObjectFactory
destroyObject
-
Constructor Details
-
JDBCConnectionFactory
-
-
Method Details
-
resetStats
public void resetStats() -
getNumPhysicalOpen
public int getNumPhysicalOpen() -
getMaxPhysicalOpen
public int getMaxPhysicalOpen() -
getNumReadOnlyOpen
public int getNumReadOnlyOpen() -
toString
-
makeObject
- Specified by:
makeObjectin interfaceorg.apache.commons.pool2.PooledObjectFactory<Connection>- Throws:
SQLException
-
createConnection
- Throws:
SQLException
-
createRawSQLConnection
- Throws:
SQLException
-
activateObject
- Specified by:
activateObjectin interfaceorg.apache.commons.pool2.PooledObjectFactory<Connection>
-
passivateObject
- Specified by:
passivateObjectin interfaceorg.apache.commons.pool2.PooledObjectFactory<Connection>
-
destroyObject
public void destroyObject(org.apache.commons.pool2.PooledObject<Connection> pooledConnection) throws SQLException - Specified by:
destroyObjectin interfaceorg.apache.commons.pool2.PooledObjectFactory<Connection>- Throws:
SQLException
-
mustValidate
-
getValidationQuery
-
validateObject
- Specified by:
validateObjectin interfaceorg.apache.commons.pool2.PooledObjectFactory<Connection>
-
enableOracleStatementCaching
public void enableOracleStatementCaching(int cacheSize) Explicitly enables oracle statement caching no matter what settings have been put into configuration.- Parameters:
cacheSize- the statement cache size
-
resetOracleStatementCaching
public void resetOracleStatementCaching()Resets oracle statements caching state. The next time a connection is being fetched these settings are reloaded from configuration. -
disableOracleStatementCaching
public void disableOracleStatementCaching()Explicitly switches off oracle statement caching. This is particular helpful if database schema changes are likely to happen afterwards.For re-enabling statement caching call either
enableOracleStatementCaching(int)orresetOracleStatementCaching(). -
isOracleStatementCachingEnabled
public boolean isOracleStatementCachingEnabled()Tells if oracle (implicit) statement caching is currently enabled. -
getJdbcSuspendSupport
-