|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--com.ibm.websphere.rsadapter.GenericDataStoreHelper | +--com.ibm.websphere.rsadapter.OracleDataStoreHelper
This is a helper class customized for the Oracle database. It allows us to plug in data store specific functions. When trying to map an exception, the Oracle errormap will be searched first then the generic one will be searched.
If you have any special Oracle requirements, you might want to look into extending this class and overwriting the methods you wish to change.
Fields inherited from class com.ibm.websphere.rsadapter.GenericDataStoreHelper |
---|
EOLN, genErrorMap, resBundle |
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, GENERIC_HELPER, INFORMIX_HELPER, MSSQL_HELPER, ORACLE_HELPER, POTENTIAL_DEADLOCK, POTENTIAL_LOST_UPDATE, SEQUELINK_HELPER, SYBASE_HELPER, SYBASE11_HELPER, TX_REPEATABLE_READ_FORUPDATE, TX_SERIALIZABLE_FORUPDATE, UPDATE_ON_READONLY, WSCONNECTJDBC_HELPER |
Constructor Summary | |
---|---|
OracleDataStoreHelper(java.util.Properties props)
Constructor, the property is passed in case some info is needed in the future, for now this parameter is not used. |
Method Summary | |
---|---|
void |
addNewMap(java.util.Map newmap)
This method is used to add user defined error maps. |
java.lang.String |
assembleSqlString(java.lang.String[] blobColumnNames,
java.lang.StringBuffer whereClause,
java.lang.String[] varValues,
java.lang.String tableName)
examples of parameters // blobColumnNames={"pic"}; // whereClause= "where id = ? and name = ?"; // varValues={"4"}; // tableName= "ITEM"; //return should be: select pic from ITEM wehre id = 4; |
void |
doSpecialBLobWork(java.sql.ResultSet rset,
java.io.InputStream[] data,
java.lang.String[] blobColumnNames)
This is a function to do any special work needed for inserting or updating a blob to work around the oracle problem precondition: the inputStream array is in the same order as the blobColumnNames , so the first entry in the data corresponds to the first entry in the blobnames array no checking for null values is there, assuming null never passed |
void |
doStatementCleanup(java.sql.PreparedStatement stmt)
Clean up a statement before it is placed in the cache. |
java.lang.Class |
findMappingClass(java.sql.SQLException e)
This method returns mapping for a given exception if one is found. |
int |
getIsolationLevel(com.ibm.websphere.appprofile.accessintent.AccessIntent aIntent)
This method returns the isolation level given the Intent object. |
int |
getLockType(com.ibm.websphere.appprofile.accessintent.AccessIntent intent)
This method returns a locktype based on the input AccessIntent update hint value. |
int |
getResultSetConcurrency(com.ibm.websphere.appprofile.accessintent.AccessIntent intent)
This method returns the resultSet concurrency given the Intent Object. |
java.lang.String |
getXAExceptionContents(javax.transaction.xa.XAException xae)
This method will be used to display in the trace file the contents of the XAException. |
java.lang.String |
hasLostUpdateOrDeadLockOccurred(int isoLevel,
boolean loadedForUpdate)
This method should be called when storing a CMP EntityBean if pessismistic concurrency control is activated. |
boolean |
isBatchUpdateSupportedWithAccessIntent(com.ibm.websphere.appprofile.accessintent.AccessIntent accessIntent)
This method is used to determine if Batch is supported with the given accessIntent object. |
int |
modifyXAFlag(int xaflag)
This method will be used modify given flag which is passed on the XA start method. |
java.lang.String |
showLockInfo(java.util.Properties props)
This method returns lock information for Oracle. |
Methods inherited from class com.ibm.websphere.rsadapter.GenericDataStoreHelper |
---|
calcPartitionNumber, doConnectionCleanup, doConnectionSetup, getMetaData, getPrintWriter, getResultSetType, isConnectionError, mapException, mapException, processGenericCredentials, setUserDefinedMap |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public OracleDataStoreHelper(java.util.Properties props)
props
- not needed here, entry will be ignoredMethod Detail |
public void doStatementCleanup(java.sql.PreparedStatement stmt) throws java.sql.SQLException
doStatementCleanup
in class GenericDataStoreHelper
stmt
- the PreparedStatement.java.sql.SQLException
- if an error occurs cleaning up the statement.public final java.lang.Class findMappingClass(java.sql.SQLException e)
If a user wants to override the mapping of a specific Exception, they can override this method and either return the same exception class or return null. In the mapexception() which calls this method if the map found is null then the original exception is returned. A user can also cancel the mapping by returning null for that exception map.
findMappingClass
in class GenericDataStoreHelper
e
- The SQLException we need to find a mapping class forpublic int getIsolationLevel(com.ibm.websphere.appprofile.accessintent.AccessIntent aIntent) throws javax.resource.ResourceException
getIsolationLevel
in class GenericDataStoreHelper
aIntent
- AccessIntentjavax.resource.ResourceException
- Intent
public int getResultSetConcurrency(com.ibm.websphere.appprofile.accessintent.AccessIntent intent) throws javax.resource.ResourceException
For Oracle, CONCUR_READ_ONLY & CONCUR_UPDATABLE are the only supported values. CONCUR_READ_ONLY is also the default JDBC value. If this value is not desired one could override it in a subclass.
getResultSetConcurrency
in class GenericDataStoreHelper
intent
- AccessIntentjavax.resource.ResourceException
- AccessIntent
public java.lang.String hasLostUpdateOrDeadLockOccurred(int isoLevel, boolean loadedForUpdate)
pre-conditions
hasLostUpdateOrDeadLockOccurred
in class GenericDataStoreHelper
isoLevel
- the isolation level used.loadedForUpdate
- true
if the CMP EntityBean
was loaded for update (eg. FOR UPDATE keywords used on SELECT).public final java.lang.String showLockInfo(java.util.Properties props) throws java.lang.Exception
showLockInfo
in class GenericDataStoreHelper
props
- Props should have the following data to establish a connection with Oracle:java.lang.Exception
- Could range from java.io exceptions to javax.sql exceptions since we are running operations
against the OSpublic final void addNewMap(java.util.Map newmap)
newmap
- a list of SQL error codes / states and the Exception classpublic int getLockType(com.ibm.websphere.appprofile.accessintent.AccessIntent intent)
getLockType
in class GenericDataStoreHelper
intent
- An AccessIntentpublic void doSpecialBLobWork(java.sql.ResultSet rset, java.io.InputStream[] data, java.lang.String[] blobColumnNames) throws com.ibm.ws.rsadapter.exceptions.DataStoreAdapterException
rset
- rset: the resultSet containing the blob row to be updateddata
- InputStream: the data to be updated into the blobblobColumnNames
- String array that contains the blob names, needed to assemble the sql string
e.g. {"col1", "col2"}com.ibm.ws.rsadapter.exceptions.DataStoreAdapterException
- public java.lang.String assembleSqlString(java.lang.String[] blobColumnNames, java.lang.StringBuffer whereClause, java.lang.String[] varValues, java.lang.String tableName)
blobColumnNames
- String[]: contains blob column nameswhereClause
- String: contains the string after where
for example:
id = ? and name=?varValues
- String array containing the values that should be
put in the where cluase ?s. For the example above, if the values are 1 and soloman
then the array should be {"1", "soloman"}tableName
- String: table namepublic java.lang.String getXAExceptionContents(javax.transaction.xa.XAException xae)
getXAExceptionContents
in class GenericDataStoreHelper
XAException
- public int modifyXAFlag(int xaflag)
modifyXAFlag
in class GenericDataStoreHelper
xaflag
- public boolean isBatchUpdateSupportedWithAccessIntent(com.ibm.websphere.appprofile.accessintent.AccessIntent accessIntent)
isBatchUpdateSupportedWithAccessIntent
in class GenericDataStoreHelper
accessIntent
- AccessIntent
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |