Package de.hybris.platform.jdbcwrapper
Class JDBCConnectionFactory
- java.lang.Object
-
- de.hybris.platform.jdbcwrapper.JDBCConnectionFactory
-
- All Implemented Interfaces:
org.apache.commons.pool2.PooledObjectFactory<java.sql.Connection>
- Direct Known Subclasses:
ConnectionErrorCheckingJDBCConnectionFactory
public class JDBCConnectionFactory extends java.lang.Object implements org.apache.commons.pool2.PooledObjectFactory<java.sql.Connection>
-
-
Constructor Summary
Constructors Constructor Description JDBCConnectionFactory(HybrisDataSource dateSource)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidactivateObject(org.apache.commons.pool2.PooledObject<java.sql.Connection> pooledConnection)protected java.sql.ConnectioncreateRawSQLConnection()voiddestroyObject(org.apache.commons.pool2.PooledObject<java.sql.Connection> pooledConnection)voiddisableOracleStatementCaching()Explicitly switches off oracle statement caching.voidenableOracleStatementCaching(int cacheSize)Explicitly enables oracle statement caching no matter what settings have been put into configuration.protected JdbcSuspendSupportgetJdbcSuspendSupport()intgetMaxPhysicalOpen()intgetNumPhysicalOpen()protected java.lang.StringgetValidationQuery()booleanisOracleStatementCachingEnabled()Tells if oracle (implicit) statement caching is currently enabled.org.apache.commons.pool2.PooledObject<java.sql.Connection>makeObject()protected booleanmustValidate(java.lang.Object obj)voidpassivateObject(org.apache.commons.pool2.PooledObject<java.sql.Connection> pooledConnection)voidresetOracleStatementCaching()Resets oracle statements caching state.voidresetStats()java.lang.StringtoString()booleanvalidateObject(org.apache.commons.pool2.PooledObject<java.sql.Connection> pooledConnection)
-
-
-
Constructor Detail
-
JDBCConnectionFactory
public JDBCConnectionFactory(HybrisDataSource dateSource)
-
-
Method Detail
-
resetStats
public void resetStats()
-
getNumPhysicalOpen
public int getNumPhysicalOpen()
-
getMaxPhysicalOpen
public int getMaxPhysicalOpen()
-
toString
public java.lang.String toString()
- Overrides:
toStringin classjava.lang.Object
-
makeObject
public org.apache.commons.pool2.PooledObject<java.sql.Connection> makeObject() throws java.sql.SQLException- Specified by:
makeObjectin interfaceorg.apache.commons.pool2.PooledObjectFactory<java.sql.Connection>- Throws:
java.sql.SQLException
-
createRawSQLConnection
protected java.sql.Connection createRawSQLConnection() throws java.sql.SQLException- Throws:
java.sql.SQLException
-
activateObject
public void activateObject(org.apache.commons.pool2.PooledObject<java.sql.Connection> pooledConnection)
- Specified by:
activateObjectin interfaceorg.apache.commons.pool2.PooledObjectFactory<java.sql.Connection>
-
passivateObject
public void passivateObject(org.apache.commons.pool2.PooledObject<java.sql.Connection> pooledConnection)
- Specified by:
passivateObjectin interfaceorg.apache.commons.pool2.PooledObjectFactory<java.sql.Connection>
-
destroyObject
public void destroyObject(org.apache.commons.pool2.PooledObject<java.sql.Connection> pooledConnection) throws java.sql.SQLException- Specified by:
destroyObjectin interfaceorg.apache.commons.pool2.PooledObjectFactory<java.sql.Connection>- Throws:
java.sql.SQLException
-
mustValidate
protected boolean mustValidate(java.lang.Object obj)
-
getValidationQuery
protected java.lang.String getValidationQuery()
-
validateObject
public boolean validateObject(org.apache.commons.pool2.PooledObject<java.sql.Connection> pooledConnection)
- Specified by:
validateObjectin interfaceorg.apache.commons.pool2.PooledObjectFactory<java.sql.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
protected JdbcSuspendSupport getJdbcSuspendSupport()
-
-