In 6.5-1 and prior version, DODS explicitly use self-generated (by DODS framework) values for object identification (OID), and uses it as base values for all primary and foreign keys columns in whole database. Although this mechanism have advantage in simplicity and easy of use, in case that we have database that is totally dedicated to DODS application(s) and built "form the ground", but they introduces some very strong constraints in case when we have already existing database or we need to use same database simultaneously from DODS and non-DODS application(s).
Since version 6.6.1 DODS have capabilities to use database generated identity (identity, auto-generated, serial .. name depends on DB vendor) values as base for DO object identification. Because now database engine is the main generator of object identity, and this values are used as primary and foreign key column values this enables DODS usage in case when we have already existing database or mix of DODS/non-DODS application that use same database.
To work with this "autogenerated" values DODS relays on JDBC driver / DB engine capabilities to retrieve this values from database. According to JDBC 3.0 specification the way to work with "autogenerated columns" is standardized on database (JDBC) driver level, but many today available jdbc drivers have incomplete implementation of JDBC 3.0 or are not JDBC 3.0 compliant at all. So, to enable work with "autogenerated columns" independent on JDBC driver specification level, and to support this feature on broader range of JDBC drivers and database vendors, DODS introduces several different mechanism implementation for retrieving autogenerated values from database.
Base for all of this "custom" implementation is DriverDependencies interface. There are several implementation of DriverDependencies interface and DODS in runtime decide which to use, based on current active database driver.
Mapping between database driver and DriverDependencies implementation is placed in DatabaseVendor configuration file (<DODS_HOME>/build/conf folder) inside <Drivers> section (DriverDependenciesClass parameter) together with other driver dependent parameters eg. (in PostgreSQLConf.xml):
<Drivers> <org.postgresql.Driver> <DriverDependenciesClass>org.enhydra.dods.dependencies.PgSqlDependencies</DriverDependenciesClass> </org.postgresql.Driver> </Drivers>
Default value for this parameter are:
org.enhydra.dods.dependencies.StandardDriverDependencies
that implements access to autogenetrated columns trough standard JDBC 3.0 compliant way.
There are also several other implementations:
org.enhydra.dods.dependencies.HsqlDbDependencies.java - for HSQL database/driver.
org.enhydra.dods.dependencies.PgSqlDependencies – for Postgers database engine.
org.enhydra.dods.dependencies.MsjdbcDriverDependencies – for MS SQL Server2000 database and Microsoft JDBC driver (msjdbc)
For all details about parmeter see " DriverDependenciesClass" section in "Database Vendor and Driver Specific Parameters." In Ch.23.
DriverDependenciesClass parameter value just maps specific implementation of DriverDependencies to specific database driver, but to enable DODS to use this implementation in runtime we need to set " ObjectIdAllocationSource" parameter in application configuration file to "database" eg.
DatabaseManager.defaults.ObjectIdAllocationSource = database
For all details about parmeter see " ObjectIdAllocationSource" section in " New Parameters in Configuration and DOML Files." In Ch.22.