Class Oracle11gDataStoreHelper
- All Implemented Interfaces:
DataStoreHelper
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 Code | SQL State | PortableSQLException subclass |
|---|---|---|
| 1 | DuplicateKeyException.class | |
| 20 | StaleConnectionException.class | |
| 28 | StaleConnectionException.class | |
| 1012 | StaleConnectionException.class | |
| 1014 | StaleConnectionException.class | |
| 1033 | StaleConnectionException.class | |
| 1034 | StaleConnectionException.class | |
| 1035 | StaleConnectionException.class | |
| 1089 | StaleConnectionException.class | |
| 1090 | StaleConnectionException.class | |
| 1092 | StaleConnectionException.class | |
| 3113 | StaleConnectionException.class | |
| 3114 | StaleConnectionException.class | |
| 12505 | StaleConnectionException.class | |
| 12541 | StaleConnectionException.class | |
| 12560 | StaleConnectionException.class | |
| 12571 | StaleConnectionException.class | |
| 17002 | StaleConnectionException.class | |
| 17008 | StaleConnectionException.class | |
| 17009 | StaleConnectionException.class | |
| 17410 | StaleConnectionException.class | |
| 17401 | StaleConnectionException.class | |
| 17430 | StaleConnectionException.class | |
| 25408 | StaleConnectionException.class | |
| 24794 | StaleConnectionException.class | |
| 17447 | StaleConnectionException.class |
-
Field Summary
Fields inherited from interface com.ibm.websphere.rsadapter.DataStoreHelper
CLOUDSCAPE_HELPER, CLOUDSCAPE_NETWORK_SERVER_HELPER, CONNECTJDBC_HELPER, CUSTOM_HELPER, DATADIRECT_HELPER, DB2_390_HELPER, DB2_390_LOCAL_HELPER, DB2_400_HELPER, DB2_HELPER, DB2_UNIVERSAL_HELPER, DERBY_HELPER, DERBY_NETWORK_SERVER_HELPER, FIRST_TIME_CALLED, GENERIC_HELPER, INFORMIX_HELPER, INFORMIX_JCC_HELPER, MSSQL_HELPER, ORACLE_10G_HELPER, ORACLE_11G_HELPER, ORACLE_HELPER, POTENTIAL_DEADLOCK, POTENTIAL_LOST_UPDATE, PROXY_DS_HELPER, SEQUELINK_HELPER, SUBJECT, SYBASE_HELPER, SYBASE11_HELPER, TX_REPEATABLE_READ_FORUPDATE, TX_SERIALIZABLE_FORUPDATE, UNDEFINED_HELPER, UNDEFINED_ISOLATOIN_LEVEL, UPDATE_ON_READONLY -
Constructor Summary
ConstructorsConstructorDescriptionThisOracle11gDataStoreHelperconstructor creates a newOracle11gDataStoreHelperbased on theDataStoreHelperproperties provided. -
Method Summary
Modifier and TypeMethodDescriptionbooleanThis method is used to clean up a connection before it is returned to the connection pool for later reuse.voidThis method cleans up a statement before it is returned to the statement cache.final ClassThis method locates thecom.ibm.websphere.ce.cm.PortableSQLExceptionsubclass corresponding to the specifiedSQLException, as defined by theOracle11gDataStoreHelper,GenericDataStoreHelper, and user-definedSQLExceptionmaps.intgetIsolationLevel(AccessIntent intent) This method determines the transaction isolation level to use as default for the database backend.intgetLockType(AccessIntent intent) This method is unused in Liberty.This method provides a plug-in point for providing meaningful logging information for anXAException.hasLostUpdateOrDeadLockOccurred(int isoLevel, boolean loadedForUpdate) This method is unused in Liberty.intmodifyXAFlag(int xaflag) This method is used only when thebranch-coupling="LOOSE"resource reference extension is specified.final StringshowLockInfo(Properties props) This method returns lock information for Oracle.Methods inherited from class com.ibm.websphere.rsadapter.OracleDataStoreHelper
doConnectionCleanupWithValidCheck, doConnectionSetupMethods inherited from class com.ibm.websphere.rsadapter.GenericDataStoreHelper
calcPartitionNumber, doConnectionCleanupPerCloseConnection, doConnectionSetupPerGetConnection, doConnectionSetupPerTransaction, getMetaData, getPasswordForUseWithTrustedContextWithAuthentication, getPrintWriter, getResultSetConcurrency, getResultSetType, isBatchUpdateSupportedWithAccessIntent, isConnectionError, isDuplicateKey, isTransientConnectionError, isUnsupported, mapException, setConfig, setUserDefinedMap
-
Constructor Details
-
Oracle11gDataStoreHelper
This
Oracle11gDataStoreHelperconstructor creates a newOracle11gDataStoreHelperbased on theDataStoreHelperproperties 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
DataStoreHelperproperties forOracle11gDataStoreHelperinclude a property,dataSourceClass, set to the Oracle JDBC driver'sDataSourceimplementation class name.- Parameters:
props-DataStoreHelperproperties.
-
-
Method Details
-
doStatementCleanup
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.
Oracle11gDataStoreHelperresets all of the statement properties listed below.method origin setter method value reset to JDBC setFetchDirectionResultSet.FETCH_FORWARDJDBC setMaxFieldSize0JDBC setMaxRows0JDBC setQueryTimeout0Oracle defineColumnTypeOracleStatement.clearDefines()Oracle defineColumnTypeBytesOracleStatement.clearDefines()Oracle defineColumnTypeCharsOracleStatement.clearDefines()Oracle setRowPrefetchOracleConnection.getDefaultRowPrefetch()Oracle setLobPrefetchSize(For JDBC driver 11.2.0.1 and up)4000The 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:
doStatementCleanupin interfaceDataStoreHelper- Overrides:
doStatementCleanupin classOracleDataStoreHelper- Parameters:
stmt- the PreparedStatement to clean up- Throws:
SQLException- if an error occurs cleaning up the statement.
-
getIsolationLevel
This method determines the transaction isolation level to use as default for the database backend. The default transaction isolation level forOracle11gDataStoreHelperisConnection.TRANSACTION_READ_COMMITTED.- Specified by:
getIsolationLevelin interfaceDataStoreHelper- Overrides:
getIsolationLevelin classGenericDataStoreHelper- Parameters:
intent- always null in Liberty- Returns:
- A transaction isolation level.
- Throws:
javax.resource.ResourceException- If a transaction isolation level cannot be determined.
-
doConnectionCleanup
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:
doConnectionCleanupin interfaceDataStoreHelper- Overrides:
doConnectionCleanupin classOracleDataStoreHelper- Parameters:
conn- TheConnectionto clean up.- Returns:
- true if the cleanup was successful.
- Throws:
SQLException- If an error occurs while cleaning up the connection.
-
findMappingClass
This method locates the
com.ibm.websphere.ce.cm.PortableSQLExceptionsubclass corresponding to the specifiedSQLException, as defined by theOracle11gDataStoreHelper,GenericDataStoreHelper, and user-definedSQLExceptionmaps. Precedence and related details ofSQLExceptionmapping are described on theDataStoreHelper.setUserDefinedMapmethod.Overriding this method is one of three options you have for modifying
SQLExceptionmapping. The other two options are overriding themapExceptionmethod and invoking thesetUserDefinedMapmethod to add a user-definedSQLExceptionmap.- Overrides:
findMappingClassin classOracleDataStoreHelper- Parameters:
e- TheSQLExceptionfor which to locate acom.ibm.websphere.ce.cm.PortableSQLExceptionsubclass.- Returns:
- The
com.ibm.websphere.ce.cm.PortableSQLExceptionsubclass matching theSQLException, or null if no match was found.
-
hasLostUpdateOrDeadLockOccurred
This method is unused in Liberty.- Specified by:
hasLostUpdateOrDeadLockOccurredin interfaceDataStoreHelper- Overrides:
hasLostUpdateOrDeadLockOccurredin classOracleDataStoreHelper
-
getLockType
This method is unused in Liberty.- Specified by:
getLockTypein interfaceDataStoreHelper- Overrides:
getLockTypein classOracleDataStoreHelper
-
getXAExceptionContents
This method provides a plug-in point for providing meaningful logging information for anXAException. The information can include details of the original exception that caused theXAException, if applicable. This method is used to obtain trace information forXAExceptions to include in trace.- Specified by:
getXAExceptionContentsin interfaceDataStoreHelper- Overrides:
getXAExceptionContentsin classOracleDataStoreHelper- Parameters:
xae- theXAException.- 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:
modifyXAFlagin interfaceDataStoreHelper- Overrides:
modifyXAFlagin classOracleDataStoreHelper- Parameters:
xaflag- The XA start flag to modify.- Returns:
- The modified XA start flag.
-
showLockInfo
This method returns lock information for Oracle. Thepropsparameter may include the following properties:- user - a user name that has a DBA authority. If not specified, a default value of null is used.
- password - the password corresponding to the user name. If not specified, a default value of null is used.
- URL - the Oracle URL from which JDBC connections are obtained. For example, jdbc:oracle:thin://@hostname:1521/dbname
- Overrides:
showLockInfoin classOracleDataStoreHelper- 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.
-