|
IBM WebSphere Application ServerTM Release 8 |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.ibm.websphere.rsadapter.GenericDataStoreHelper
com.ibm.websphere.rsadapter.OracleDataStoreHelper
com.ibm.websphere.rsadapter.Oracle10gDataStoreHelper
com.ibm.websphere.rsadapter.Oracle11gDataStoreHelper
public class Oracle11gDataStoreHelper
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 class com.ibm.websphere.rsadapter.GenericDataStoreHelper |
---|
customDefinedWasDefaultIsoLevel, defaultQueryTimeout, EOLN, genErrorMap, resBundle, tranErrorList |
Constructor Summary | |
---|---|
Oracle11gDataStoreHelper(java.util.Properties props)
This Oracle11gDataStoreHelper constructor creates a new
Oracle11gDataStoreHelper based on the DataStoreHelper
properties provided. |
Method Summary | |
---|---|
boolean |
doConnectionCleanup(java.sql.Connection conn)
This method is used to clean up a connection before it is returned to the connection pool for later reuse. |
void |
doStatementCleanup(java.sql.PreparedStatement stmt)
This method cleans up a statement before it is returned to the statement cache. |
java.lang.Class |
findMappingClass(java.sql.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. |
int |
getIsolationLevel(AccessIntent aIntent)
This method determines the transaction isolation level based on the specified AccessIntent . |
int |
getLockType(AccessIntent intent)
This method returns a lock type constant based on the update hint value of the specified AccessIntent. |
int |
getResultSetConcurrency(AccessIntent intent)
This method determines the result set concurrency based on the specified AccessIntent . |
java.lang.String |
getXAExceptionContents(javax.transaction.xa.XAException xae)
This method provides a plug-in point for providing meaningful logging information for an XAException . |
java.lang.String |
hasLostUpdateOrDeadLockOccurred(int isoLevel,
boolean loadedForUpdate)
This method is invoked when storing a CMP EntityBean if pessimistic concurrency control is activated. |
boolean |
isBatchUpdateSupportedWithAccessIntent(AccessIntent accessIntent)
This method is used to determine if CMP Entity Beans can support batch updates with the given AccessIntent. |
int |
modifyXAFlag(int xaflag)
This method is used only when the transactionBranchesLooselyCoupled
custom DataSource property is set to true. |
java.lang.String |
showLockInfo(java.util.Properties props)
This method returns lock information for Oracle. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public Oracle11gDataStoreHelper(java.util.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.
props
- DataStoreHelper
properties.Method Detail |
---|
public void doStatementCleanup(java.sql.PreparedStatement stmt) throws java.sql.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 drivers >= 11.2.0.1) |
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.
doStatementCleanup
in interface DataStoreHelper
doStatementCleanup
in class OracleDataStoreHelper
stmt
- the PreparedStatement to clean up
java.sql.SQLException
- if an error occurs cleaning up the statement.public int getResultSetConcurrency(AccessIntent intent) throws javax.resource.ResourceException
AccessIntent
.
Oracle11gDataStoreHelper
returns
java.sql.ResultSet.CONCUR_UPDATABLE
if the access type of the
AccessIntent
is AccessIntent.ACCESS_TYPE_UPDATE
, and
otherwise java.sql.ResultSet.CONCUR_READ_ONLY
.
Note, however, that for performance reasons, this method will always return
java.sql.ResultSet.CONCUR_READ_ONLY
getResultSetConcurrency
in interface DataStoreHelper
getResultSetConcurrency
in class Oracle10gDataStoreHelper
intent
- An AccessIntent
.
java.sql.ResultSet
.
javax.resource.ResourceException
- If a result set concurrency cannot be determined
from the AccessIntent
.public int getIsolationLevel(AccessIntent aIntent) throws javax.resource.ResourceException
AccessIntent
.
If the AccessIntent
parameter is null, a default value is returned
that is appropriate for the database backend. The default transaction isolation level
for Oracle11gDataStoreHelper
is
Connection.TRANSACTION_READ_COMMITTED.
In the case where an AccessIntent
is specified,
Oracle11gDataStoreHelper
computes the transation isolation level
from the following table based on the pessimistic update lock hint.
pessimistic update lock hint | transaction isolation level |
---|---|
AccessIntent.PESSIMISTIC_UPDATE_LOCK_HINT_NONE AccessIntent.PESSIMISTIC_UPDATE_LOCK_HINT_WEAKEST_LOCK_AT_LOAD AccessIntent.PESSIMISTIC_UPDATE_LOCK_HINT_NOCOLLISION |
Connection.TRANSACTION_READ_COMMITTED |
AccessIntent.PESSIMISTIC_UPDATE_LOCK_HINT_EXCLUSIVE |
Connection.TRANSACTION_SERIALIZABLE |
getIsolationLevel
in interface DataStoreHelper
getIsolationLevel
in class Oracle10gDataStoreHelper
aIntent
- An AccessIntent
AccessIntent
.
javax.resource.ResourceException
- If a transaction isolation level cannot be determined
from the AccessIntent
.public boolean doConnectionCleanup(java.sql.Connection conn) throws java.sql.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.
doConnectionCleanup
in interface DataStoreHelper
doConnectionCleanup
in class OracleDataStoreHelper
conn
- The Connection
to clean up.
SQLException
- The clean up of the Oracle connection failed.
java.sql.SQLException
- If an error occurs while cleaning up the connection.public final java.lang.Class findMappingClass(java.sql.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.
findMappingClass
in class OracleDataStoreHelper
e
- The SQLException
for which to locate a
com.ibm.websphere.ce.cm.PortableSQLException
subclass.
com.ibm.websphere.ce.cm.PortableSQLException
subclass matching
the SQLException
, or null if no match was found.public java.lang.String hasLostUpdateOrDeadLockOccurred(int isoLevel, boolean loadedForUpdate)
pre-conditions
hasLostUpdateOrDeadLockOccurred
in interface DataStoreHelper
hasLostUpdateOrDeadLockOccurred
in class OracleDataStoreHelper
isoLevel
- the transaction isolation level used.loadedForUpdate
- true
if the CMP EntityBean
was loaded for update (eg. FOR UPDATE keywords used on SELECT),
otherwise false.
public int getLockType(AccessIntent intent)
This method returns a lock type constant based on the update hint value of the
specified AccessIntent.
The lock type is used by the persistence manager to determine which locking hints
are used on a SELECT
statement.
Oracle11gDataStoreHelper
returns
WSInteractionSpec.LOCKTYPE_SELECT_FOR_UPDATE
if the
AccessIntent
is null or if all of the following are true:
AccessIntent.ACCESS_TYPE_UPDATE
.AccessIntent.CONCURRENCY_CONTROL_PESSIMISTIC
.AccessIntent.PESSIMISTIC_UPDATE_LOCK_HINT_NOCOLLISION
.
In all other cases, WSInteractionSpec.LOCKTYPE_SELECT
is returned.
getLockType
in interface DataStoreHelper
getLockType
in class OracleDataStoreHelper
intent
- An AccessIntent
com.ibm.websphere.rsadapter.WSInteractionSpec
:
LOCKTYPE_SELECT
LOCKTYPE_SELECT_FOR_UPDATE
public java.lang.String getXAExceptionContents(javax.transaction.xa.XAException xae)
XAException
. The information can include details of the original
exception that caused the XAException
, if applicable.
WebSphere uses this method to obtain trace information for
XAException
s to include in WebSphere trace.
getXAExceptionContents
in interface DataStoreHelper
getXAExceptionContents
in class OracleDataStoreHelper
xae
- the XAException
.
XAException
, for inclusion in
a WebSphere trace.public int modifyXAFlag(int xaflag)
This method is used only when the transactionBranchesLooselyCoupled
custom DataSource property is set to true.
This method modifies the given XA start flag, adding the proprietary Oracle flag,
OracleXAResource.ORATRANSLOOSE
.
modifyXAFlag
in interface DataStoreHelper
modifyXAFlag
in class OracleDataStoreHelper
xaflag
- The XA start flag to modify.
public boolean isBatchUpdateSupportedWithAccessIntent(AccessIntent accessIntent)
Oracle11gDataStoreHelper
returns false if the concurrency control of the
AccessIntent
is AccessIntent.CONCURRENCY_CONTROL_OPTIMISTIC
,
and otherwise returns true.
isBatchUpdateSupportedWithAccessIntent
in interface DataStoreHelper
isBatchUpdateSupportedWithAccessIntent
in class OracleDataStoreHelper
accessIntent
- AccessIntent
public final java.lang.String showLockInfo(java.util.Properties props) throws java.lang.Exception
props
parameter may include the following properties:
showLockInfo
in class OracleDataStoreHelper
props
- properties containing information needed to connect to the database.
java.lang.Exception
- if an error occurs while collecting the lock information.
|
IBM WebSphere Application ServerTM Release 8 |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |