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 Details

    • JDBCConnectionFactory

      public JDBCConnectionFactory(HybrisDataSource dateSource)
  • Method Details

    • resetStats

      public void resetStats()
    • getNumPhysicalOpen

      public int getNumPhysicalOpen()
    • getMaxPhysicalOpen

      public int getMaxPhysicalOpen()
    • getNumReadOnlyOpen

      public int getNumReadOnlyOpen()
    • toString

      public String toString()
      Overrides:
      toString in class Object
    • makeObject

      public org.apache.commons.pool2.PooledObject<Connection> makeObject() throws SQLException
      Specified by:
      makeObject in interface org.apache.commons.pool2.PooledObjectFactory<Connection>
      Throws:
      SQLException
    • createConnection

      protected Connection createConnection() throws SQLException
      Throws:
      SQLException
    • createRawSQLConnection

      protected Connection createRawSQLConnection() throws SQLException
      Throws:
      SQLException
    • activateObject

      public void activateObject(org.apache.commons.pool2.PooledObject<Connection> pooledConnection)
      Specified by:
      activateObject in interface org.apache.commons.pool2.PooledObjectFactory<Connection>
    • passivateObject

      public void passivateObject(org.apache.commons.pool2.PooledObject<Connection> pooledConnection)
      Specified by:
      passivateObject in interface org.apache.commons.pool2.PooledObjectFactory<Connection>
    • destroyObject

      public void destroyObject(org.apache.commons.pool2.PooledObject<Connection> pooledConnection) throws SQLException
      Specified by:
      destroyObject in interface org.apache.commons.pool2.PooledObjectFactory<Connection>
      Throws:
      SQLException
    • mustValidate

      protected boolean mustValidate(Object obj)
    • getValidationQuery

      protected String getValidationQuery()
    • validateObject

      public boolean validateObject(org.apache.commons.pool2.PooledObject<Connection> pooledConnection)
      Specified by:
      validateObject in interface org.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) or resetOracleStatementCaching().

    • isOracleStatementCachingEnabled

      public boolean isOracleStatementCachingEnabled()
      Tells if oracle (implicit) statement caching is currently enabled.
    • getJdbcSuspendSupport

      protected JdbcSuspendSupport getJdbcSuspendSupport()