Class Oracle11gDataStoreHelper

All Implemented Interfaces:
DataStoreHelper

public class Oracle11gDataStoreHelper extends Oracle10gDataStoreHelper
Oracle11gDataStoreHelper is a DataStoreHelper implementation customized for the Oracle 11g database.

If you have additional requirements on Oracle11g you should consider subclassing this implementation.

Note: This class and its methods can not be called or referenced directly by user applications.

Note: Custom helpers that extend this class can override or call any methods documented for this class. Customer helpers should not bypass methods provided by this class by directly calling methods on the Oracle10gDataStoreHelper or the OracleDataStoreHelper. These classes will be not be inherited by this class in a future release. This class continues to inherit GenericDataStoreHelper and the methods and constants from that class and the DataStoreHelper interface can be overridden or used directly.

When mapping a SQLException, the SQLException mappings from the Oracle11gDataStoreHelper are searched first, and subsequently, if no match is found, the SQLException mappings from the GenericDataStoreHelper are searched.

SQLException mappings specific to the Oracle11gDataStoreHelper are the following:

Error CodeSQL StatePortableSQLException subclass
1DuplicateKeyException.class
20StaleConnectionException.class
28StaleConnectionException.class
1012StaleConnectionException.class
1014StaleConnectionException.class
1033StaleConnectionException.class
1034StaleConnectionException.class
1035StaleConnectionException.class
1089StaleConnectionException.class
1090StaleConnectionException.class
1092StaleConnectionException.class
3113StaleConnectionException.class
3114StaleConnectionException.class
12505StaleConnectionException.class
12541StaleConnectionException.class
12560StaleConnectionException.class
12571StaleConnectionException.class
17002StaleConnectionException.class
17008StaleConnectionException.class
17009StaleConnectionException.class
17410StaleConnectionException.class
17401StaleConnectionException.class
17430StaleConnectionException.class
25408StaleConnectionException.class
24794StaleConnectionException.class
17447StaleConnectionException.class
  • Constructor Details

    • Oracle11gDataStoreHelper

      public Oracle11gDataStoreHelper(Properties props)

      This Oracle11gDataStoreHelper constructor creates a new Oracle11gDataStoreHelper based on the DataStoreHelper properties provided. All implementations inheriting from a data store helper must supply this same list of properties to their super class by invoking the constructor of their super class with the list of properties.

      The DataStoreHelper properties for Oracle11gDataStoreHelper include a property, dataSourceClass, set to the Oracle JDBC driver's DataSource implementation class name.

      Parameters:
      props - DataStoreHelper properties.
  • Method Details

    • doStatementCleanup

      public void doStatementCleanup(PreparedStatement stmt) throws SQLException

      This method cleans up a statement before it is returned to the statement cache. This method is called only for statements that will be cached. It is called only if at least one of the following statement APIs was invoked. Each method in the table shows what it will be set to when the statement is returned to the cache.

      Oracle11gDataStoreHelper resets all of the statement properties listed below.

      method origin setter method value reset to
      JDBC setFetchDirection ResultSet.FETCH_FORWARD
      JDBC setMaxFieldSize 0
      JDBC setMaxRows 0
      JDBC setQueryTimeout 0
      Oracle defineColumnType OracleStatement.clearDefines()
      Oracle defineColumnTypeBytes OracleStatement.clearDefines()
      Oracle defineColumnTypeChars OracleStatement.clearDefines()
      Oracle setRowPrefetch OracleConnection.getDefaultRowPrefetch()
      Oracle setLobPrefetchSize (For JDBC driver 11.2.0.1 and up) 4000

      The following operations do not need to be included in the statement cleanup since they are automatically performed by WebSphere Application Server when caching statements,

      • setFetchSize(0)
      • clearParameters()
      • clearWarnings()

      A helper class implementing this method may choose to do additional cleanup for the statement. However, this should never include closing the statement, since the statement is intended to be cached.

      Specified by:
      doStatementCleanup in interface DataStoreHelper
      Overrides:
      doStatementCleanup in class OracleDataStoreHelper
      Parameters:
      stmt - the PreparedStatement to clean up
      Throws:
      SQLException - if an error occurs cleaning up the statement.
    • getIsolationLevel

      public int getIsolationLevel(AccessIntent intent) throws javax.resource.ResourceException
      This method determines the transaction isolation level to use as default for the database backend. The default transaction isolation level for Oracle11gDataStoreHelper is Connection.TRANSACTION_READ_COMMITTED.
      Specified by:
      getIsolationLevel in interface DataStoreHelper
      Overrides:
      getIsolationLevel in class GenericDataStoreHelper
      Parameters:
      intent - always null in Liberty
      Returns:
      A transaction isolation level.
      Throws:
      javax.resource.ResourceException - If a transaction isolation level cannot be determined.
    • doConnectionCleanup

      public boolean doConnectionCleanup(Connection conn) throws SQLException

      This method is used to clean up a connection before it is returned to the connection pool for later reuse.

      If the Oracle connection has a proxy session associated with it, the proxy session is closed.

      Specified by:
      doConnectionCleanup in interface DataStoreHelper
      Overrides:
      doConnectionCleanup in class OracleDataStoreHelper
      Parameters:
      conn - The Connection to clean up.
      Returns:
      true if the cleanup was successful.
      Throws:
      SQLException - If an error occurs while cleaning up the connection.
    • findMappingClass

      public final Class findMappingClass(SQLException e)

      This method locates the com.ibm.websphere.ce.cm.PortableSQLException subclass corresponding to the specified SQLException, as defined by the Oracle11gDataStoreHelper, GenericDataStoreHelper, and user-defined SQLException maps. Precedence and related details of SQLException mapping are described on the DataStoreHelper.setUserDefinedMap method.

      Overriding this method is one of three options you have for modifying SQLException mapping. The other two options are overriding the mapException method and invoking the setUserDefinedMap method to add a user-defined SQLException map.

      Overrides:
      findMappingClass in class OracleDataStoreHelper
      Parameters:
      e - The SQLException for which to locate a com.ibm.websphere.ce.cm.PortableSQLException subclass.
      Returns:
      The com.ibm.websphere.ce.cm.PortableSQLException subclass matching the SQLException, or null if no match was found.
    • hasLostUpdateOrDeadLockOccurred

      public String hasLostUpdateOrDeadLockOccurred(int isoLevel, boolean loadedForUpdate)
      This method is unused in Liberty.
      Specified by:
      hasLostUpdateOrDeadLockOccurred in interface DataStoreHelper
      Overrides:
      hasLostUpdateOrDeadLockOccurred in class OracleDataStoreHelper
    • getLockType

      public int getLockType(AccessIntent intent)
      This method is unused in Liberty.
      Specified by:
      getLockType in interface DataStoreHelper
      Overrides:
      getLockType in class OracleDataStoreHelper
    • getXAExceptionContents

      public String getXAExceptionContents(XAException xae)
      This method provides a plug-in point for providing meaningful logging information for an XAException. The information can include details of the original exception that caused the XAException, if applicable. This method is used to obtain trace information for XAExceptions to include in trace.
      Specified by:
      getXAExceptionContents in interface DataStoreHelper
      Overrides:
      getXAExceptionContents in class OracleDataStoreHelper
      Parameters:
      xae - the XAException.
      Returns:
      detailed information about the XAException, for inclusion in trace.
    • modifyXAFlag

      public int modifyXAFlag(int xaflag)

      This method is used only when the branch-coupling="LOOSE" resource reference extension is specified. This method modifies the given XA start flag, adding the proprietary Oracle flag, OracleXAResource.ORATRANSLOOSE.

      Specified by:
      modifyXAFlag in interface DataStoreHelper
      Overrides:
      modifyXAFlag in class OracleDataStoreHelper
      Parameters:
      xaflag - The XA start flag to modify.
      Returns:
      The modified XA start flag.
    • showLockInfo

      public final String showLockInfo(Properties props) throws Exception
      This method returns lock information for Oracle. The props parameter may include the following properties:

      1. user - a user name that has a DBA authority. If not specified, a default value of null is used.
      2. password - the password corresponding to the user name. If not specified, a default value of null is used.
      3. URL - the Oracle URL from which JDBC connections are obtained. For example, jdbc:oracle:thin://@hostname:1521/dbname
      Overrides:
      showLockInfo in class OracleDataStoreHelper
      Parameters:
      props - properties containing information needed to connect to the database.
      Returns:
      the lock information for Oracle.
      Throws:
      Exception - if an error occurs while collecting the lock information.