SolarMetric Kodo JDO 2.5.8 generated on January 11 2004

com.solarmetric.kodo.impl.jdbc.schema.dict
Class InformixDictionary

java.lang.Object
  |
  +--com.solarmetric.kodo.impl.jdbc.schema.dict.AbstractDictionary
        |
        +--com.solarmetric.kodo.impl.jdbc.schema.dict.InformixDictionary
All Implemented Interfaces:
DBDictionary

public class InformixDictionary
extends AbstractDictionary

Dictionary for Informix. Notable features are:

  1. Informix does not allow pessimistic locking on scrollable result sets. This means that large result set support will be disabled when transactions are not optimisitic.
  2. SET LOCK MODE TO WAIT N statements are issued to not fail immediately when a lock is encountered. See getLockWaitSeconds() and getLockModeEnabled.
  3. LOCK MODE ROW is used by default for table creation to allow the maximum concurrency.

Since:
2.4

Fields inherited from class com.solarmetric.kodo.impl.jdbc.schema.dict.AbstractDictionary
CENTI, DECI, meta, MICRO, MILLI, NANO, NUMBER_FORMAT, SEC
 
Constructor Summary
InformixDictionary()
           
 
Method Summary
 void createdSQLExecutionManager(SQLExecutionManager manager)
          Informix need to invoke "SET LOCK MODE ..." statement on all Connections, since otherwise inserts against a locked table will not wait to obtain a lock, but will fail immediately.
 SQLBuffer[] getCreateTableSQL(Table table)
          Return a series of SQL statements to create the given table, including any indexes it has.
 boolean getLockModeEnabled()
          If true, then we will issue a "SET LOCK MODE TO WAIT N" statement whenever we create a Connection, in order allow waiting on locks.
 int getLockWaitSeconds()
          If getLockModeEnabled() is true, then this parameter specifies the number of seconds we will wait to obtain a lock for inserts and pessimistic locking.
 PreparedStatement prepareStatement(Connection conn, SQLBuffer buffer, SQLExecutionManager manager, int type, int concur)
          Informix does not allow "SELECT ...
 void setLockModeEnabled(boolean lockModeEnabled)
          If true, then we will issue a "SET LOCK MODE TO WAIT N" statement whenever we create a Connection, in order allow waiting on locks.
 void setLockWaitSeconds(int lockWaitSeconds)
          If getLockModeEnabled() is true, then this parameter specifies the number of seconds we will wait to obtain a lock for inserts and pessimistic locking.
protected  void setupSQLTypeMap(SQLTypeMap map)
          This is the most commonly overridden method when porting to a new database.
 SQLBuffer toSelect(String[] cols, String[] tables, SQLBuffer where, SQLBuffer order, boolean dstnct, boolean update)
          Informix only supports locking when where is only one table, and not if it is a distinct query.
 
Methods inherited from class com.solarmetric.kodo.impl.jdbc.schema.dict.AbstractDictionary
, addForUpdateClause, bigDecimalFromSQL, bigDecimalToPreparedParameter, bigDecimalToSQL, bigIntegerFromSQL, bigIntegerToPreparedParameter, bigIntegerToSQL, blobFromSQL, blobToPreparedParameter, blobToSQL, booleanFromSQL, booleanToPreparedParameter, booleanToSQL, byteFromSQL, byteToPreparedParameter, byteToSQL, characterToPreparedParameter, charFromSQL, charToSQL, clobFromSQL, clobToPreparedParameter, clobToSQL, colsToString, dateFromSQL, dateToPreparedParameter, dateToSQL, dateToTimestamp, deserialize, deserialize, doubleFromSQL, doubleToPreparedParameter, doubleToSQL, dropTableDropsIndices, floatFromSQL, floatToPreparedParameter, floatToSQL, fromSQL, getAddColumnSQL, getClassMappingCandidateClasses, getColumnDeclaration, getColumns, getCreateIndexSQL, getCreateTableSuffix, getDatePrecision, getDBMetaData, getDropColumnSQL, getDropIndexSQL, getDropTableSQL, getFieldMappingCandidateClasses, getMaxColumnNameLength, getMaxIndexNameLength, getMaxTableNameLength, getNameTruncationVersion, getNextAutoIncrementValue, getNonSQL92LeftOuterJoin, getPlatform, getPrimaryKeyClause, getQuoteNumbers, getSchemaName, getSimulateLocking, getSQLTypeMap, getStoreCharsAsStrings, getStoreLargeNumbersAsStrings, getSupportedResultSetType, getTables, getValidateConnections, getValidateConnectionSQL, getValidColumnName, getValidIndexName, getValidTableName, initTypeMap, intFromSQL, intToPreparedParameter, intToSQL, isClosed, localeFromSQL, localeToPreparedParameter, localeToSQL, longFromSQL, longToPreparedParameter, longToSQL, objectFromSQL, objectToPreparedParameter, objectToSQL, prepareLargeNumberAsString, serialize, setColumnNameGenerator, setCreateTableSuffix, setDBMetaData, setIndexNameGenerator, setMaxColumnNameLength, setMaxIndexNameLength, setMaxTableNameLength, setNameTruncationVersion, setNullParameter, setQuoteNumbers, setSchemaName, setSimulateLocking, setStoreCharsAsStrings, setStoreLargeNumbersAsStrings, setTableNameGenerator, setTransactionIsolation, setValidateConnections, setValidateConnectionSQL, shortFromSQL, shortToPreparedParameter, shortToSQL, stringFromSQL, stringToPreparedParameter, stringToSQL, supportsAutoIncrement, supportsLocking, supportsNonSQL92LeftOuterJoins, supportsUpdateCountsForBatch, tablesToString, timestampFromSQL, toPreparedParameter, toSelect, toSelect, toSQL, truncate, truncate, validateConfiguration
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

InformixDictionary

public InformixDictionary()
Method Detail

setupSQLTypeMap

protected void setupSQLTypeMap(SQLTypeMap map)
Description copied from class: AbstractDictionary
This is the most commonly overridden method when porting to a new database. Most databases have different mappings between java and SQL types; this method can be used to setup the mappings for the database being ported.
Overrides:
setupSQLTypeMap in class AbstractDictionary

getCreateTableSQL

public SQLBuffer[] getCreateTableSQL(Table table)
Description copied from interface: DBDictionary
Return a series of SQL statements to create the given table, including any indexes it has.
Overrides:
getCreateTableSQL in class AbstractDictionary

createdSQLExecutionManager

public void createdSQLExecutionManager(SQLExecutionManager manager)
Informix need to invoke "SET LOCK MODE ..." statement on all Connections, since otherwise inserts against a locked table will not wait to obtain a lock, but will fail immediately.
Overrides:
createdSQLExecutionManager in class AbstractDictionary

prepareStatement

public PreparedStatement prepareStatement(Connection conn,
                                          SQLBuffer buffer,
                                          SQLExecutionManager manager,
                                          int type,
                                          int concur)
                                   throws SQLException
Informix does not allow "SELECT ... FOR UPDATE" statements to be executed against scrollable cursors.
Overrides:
prepareStatement in class AbstractDictionary
Following copied from interface: com.solarmetric.kodo.impl.jdbc.schema.DBDictionary
Returns:
the newly prepared statement

toSelect

public SQLBuffer toSelect(String[] cols,
                          String[] tables,
                          SQLBuffer where,
                          SQLBuffer order,
                          boolean dstnct,
                          boolean update)
Informix only supports locking when where is only one table, and not if it is a distinct query. This sort of query will throw an exception up from, unless #getSimulateLocking) is true.
Overrides:
toSelect in class AbstractDictionary
Following copied from interface: com.solarmetric.kodo.impl.jdbc.schema.DBDictionary
Parameters:
cols - list of values the columns to select
tables - list of the tables to select from
where - the WHERE conditions; may be null if none
order - the ORDER BY conditions; may be null if none
distinct - if true, this should be a SELECT DISTINCT-equivalent query
update - if true this should be a SELECT FOR UPDATE-equivalent query

setLockModeEnabled

public void setLockModeEnabled(boolean lockModeEnabled)
If true, then we will issue a "SET LOCK MODE TO WAIT N" statement whenever we create a Connection, in order allow waiting on locks.

getLockModeEnabled

public boolean getLockModeEnabled()
If true, then we will issue a "SET LOCK MODE TO WAIT N" statement whenever we create a Connection, in order allow waiting on locks.

setLockWaitSeconds

public void setLockWaitSeconds(int lockWaitSeconds)
If getLockModeEnabled() is true, then this parameter specifies the number of seconds we will wait to obtain a lock for inserts and pessimistic locking.

getLockWaitSeconds

public int getLockWaitSeconds()
If getLockModeEnabled() is true, then this parameter specifies the number of seconds we will wait to obtain a lock for inserts and pessimistic locking.

SolarMetric Kodo JDO 2.5.8 generated on January 11 2004

Copyright 2001,2002,2003 SolarMetric, Inc. All Rights Reserved.