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 void
activateObject(org.apache.commons.pool2.PooledObject<java.sql.Connection> pooledConnection)
protected java.sql.Connection
createRawSQLConnection()
void
destroyObject(org.apache.commons.pool2.PooledObject<java.sql.Connection> pooledConnection)
void
disableOracleStatementCaching()
Explicitly switches off oracle statement caching.void
enableOracleStatementCaching(int cacheSize)
Explicitly enables oracle statement caching no matter what settings have been put into configuration.protected JdbcSuspendSupport
getJdbcSuspendSupport()
int
getMaxPhysicalOpen()
int
getNumPhysicalOpen()
protected java.lang.String
getValidationQuery()
boolean
isOracleStatementCachingEnabled()
Tells if oracle (implicit) statement caching is currently enabled.org.apache.commons.pool2.PooledObject<java.sql.Connection>
makeObject()
protected boolean
mustValidate(java.lang.Object obj)
void
passivateObject(org.apache.commons.pool2.PooledObject<java.sql.Connection> pooledConnection)
void
resetOracleStatementCaching()
Resets oracle statements caching state.void
resetStats()
java.lang.String
toString()
boolean
validateObject(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:
toString
in classjava.lang.Object
-
makeObject
public org.apache.commons.pool2.PooledObject<java.sql.Connection> makeObject() throws java.sql.SQLException
- Specified by:
makeObject
in 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:
activateObject
in interfaceorg.apache.commons.pool2.PooledObjectFactory<java.sql.Connection>
-
passivateObject
public void passivateObject(org.apache.commons.pool2.PooledObject<java.sql.Connection> pooledConnection)
- Specified by:
passivateObject
in 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:
destroyObject
in 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:
validateObject
in 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()
-
-