Table of Contents
Kodo JDO defines many properties of its own. Most of these properties are provided for advanced users who wish to customize Kodo JDO's behavior; the majority of developers can omit them. A complete listing of Kodo JDO-specific properties is given below.
Property name: com.solarmetric.kodo.CacheReferenceSize
Configuration API: com.solarmetric.kodo.conf.Configuration.getCacheReferenceSize
Resource adaptor config-property: CacheReferenceSize
Default:1000
Description: The number of hard references to cached objects that the PersistenceManager's cache will retain (in addition to the soft reference cache that it maintains). Setting this to a higher value will result in more objects being retained in the cache, at the cost of utilizing more memory resources. Setting this to -1 will cause all loaded objects to have hard references.
Property name: com.solarmetric.kodo.DataCacheClass
Configuration API: com.solarmetric.kodo.conf.Configuration.getDataCacheClass
Resource adaptor config-property: DataCacheClass
Default: none
Description: The name of the class to use for caching of data loaded from the data store. Must implement com.solarmetric.kodo.runtime.datacache.DataCache.
Property name: com.solarmetric.kodo.ConnectionProperties
Configuration API: com.solarmetric.kodo.conf.Configuration.getConnectionProperties
Resource adaptor config-property: ConnectionProperties
Default: none
Description: A space-separated list of properties to be passed to the JDBC Driver when obtaining a Connection. Properties are of the form "key=value".
Example 2.1. Specifying Connection Properties
com.solarmetric.kodo.ConnectionProperties: serverName=myserver port=1266
If a javax.sql.DataSource class is defined in the javax.jdo.option.ConnectionDriverName property, then this property will be used to set bean-like properties in the DataSource instance upon creation. These properties vary depending on the DataSource in use: see the documentation for your DataSource for details on the properties to use.
Example 2.2. Specifying DataSource Properties
javax.jdo.option.ConnectionDriverName=oracle.jdbc.pool.OracleDataSource com.solarmetric.kodo.ConnectionProperties=PortNumber=1521 \ ServerName=saturn \ DatabaseName=solarsid \ DriverType=thin
Property name: com.solarmetric.kodo.DataCacheProperties
Configuration API: com.solarmetric.kodo.conf.Configuration.getDataCacheProperties
Resource adaptor config-property: DataCacheProperties
Default: none
Description: A space-separated list of properties to pass to the class defined in com.solarmetric.kodo.DataCacheClass upon initialization. See the caching documentation for details on possible values.
Property name: com.solarmetric.kodo.DefaultFetchThreshold
Configuration API: com.solarmetric.kodo.conf.Configuration.getDefaultFetchThreshold
Resource adaptor config-property: DefaultFetchThreshold
Default: 30
Description: The threshold below which result lists will be completely instantiated upon their creation. A value of -1 will always force all results to be completely instantiated, thus disabling lazy result loading.
Property name: com.solarmetric.kodo.DefaultFetchBatchSize
Configuration API: com.solarmetric.kodo.conf.Configuration.getDefaultFetchBatchSize
Resource adaptor config-property: DefaultFetchBatchSize
Default: 10
Description: The number of rows that will be pre-fetched when an element in a Query result is accessed.
Property name: com.solarmetric.kodo.EnableQueryExtensions
Configuration API: com.solarmetric.kodo.conf.Configuration.getEnableQueryExtensions
Resource adaptor config-property: EnableQueryExtensions
Default: false
Description: If true, then Kodo JDO will allow the use of query filter extensions. See the query extensions documentation for more information.
Property name: com.solarmetric.kodo.LicenseKey
Configuration API: com.solarmetric.kodo.conf.Configuration.getLicenseKey
Resource adaptor config-property: LicenseKey
Default: none
Description: The license key provided to you by SolarMetric. Keys are available at www.solarmetric.com
Property name: com.solarmetric.kodo.PersistenceManagerClass
Configuration API: com.solarmetric.kodo.conf.Configuration.getPersistenceManagerClass
Resource adaptor config-property: PersistenceManagerClass
Default: com.solarmetric.kodo.runtime.PersistenceManagerImpl
Description: The name of the class that the PersistenceManagerFactory should create when creating a new PersistenceManagerImpl. Must extend com.solarmetric.kodo.runtime.PersistenceManagerImpl.
Property name: com.solarmetric.kodo.PersistenceManagerProperties
Configuration API: com.solarmetric.kodo.conf.Configuration.getPersistenceManagerProperties
Resource adaptor config-property: PersistenceManagerProperties
Default: none
Description: A space-separated list of properties to pass to the class defined in com.solarmetric.kodo.PersistenceManagerClass upon initialization.
Property name: com.solarmetric.kodo.ProxyManagerClass
Configuration API: com.solarmetric.kodo.conf.Configuration.getProxyManagerClass
Resource adaptor config-property: ProxyManagerClass
Default: com.solarmetric.kodo.util.SimpleProxyManager
Description: The name of the class to use to proxy second class objects in managed instances. Must implement com.solarmetric.kodo.util.ProxyManager.
Property name: com.solarmetric.kodo.ProxyManagerProperties
Configuration API: com.solarmetric.kodo.conf.Configuration.getProxyManagerProperties
Resource adaptor config-property: ProxyManagerProperties
Default: none
Description: A space-separated list of properties to pass to the class defined in com.solarmetric.kodo.ProxyManagerClass upon initialization.
Property name: com.solarmetric.kodo.QueryFilterListeners
Configuration API: com.solarmetric.kodo.conf.Configuration.getQueryFilterListeners
Resource adaptor config-property: QueryFilterListeners
Default: none
Description: A list of query filter listeners to add to the default list of extensions. Ignored if com.solarmetric.kodo.EnableQueryExtensions is false.
Property name: com.solarmetric.kodo.UseSoftTransactionCache
Configuration API: com.solarmetric.kodo.conf.Configuration.getUseSoftTransactionCache
Resource adaptor config-property: UseSoftTransactionCache
Default: false
Description:Sets whether or not Kodo should maintain soft references to transactional items that have not been dirtied. This can be useful in esoteric situations involving iterating through a massive list of objects within a transaction but only dirtying a couple towards the end of the list. However, there is a noticeable performance impact involved with turning this option on, in particular when loading massive lists of objects into a transaction.
Property name: com.solarmetric.kodo.PersistentTypes
Configuration API: com.solarmetric.kodo.conf.Configuration.getPersistentTypes
Resource adaptor config-property: PersistentTypes
Default: none
Description: A comma-separated list of classes that are to be instantiated whenever a new PersistenceManager is created. This property is optional, but it can be used to get around known deficiencies in the JDO specification whereby locating a persistent instance based in an application id class is not possible until the target persistent class has been loaded by the JVM. This property is also used to optimize datastore subclass identification: normally, subclass location is done by issuing a "SELECT DISTINCT [subclass identifier column]" statement. This property makes that identification unnecessary, which can lead to some performance benefits at initialization time when for very large tables. If this property is set, then all the persistent types in the system must be enumerated; failure to do so will lead to a warning, and may result in a failure to correctly locate subclasses for a persistent inheritance model.
Property name: com.solarmetric.kodo.impl.jdbc.ConnectionTestTimeout
Configuration API: com.solarmetric.kodo.impl.jdbc.JDBCConfiguration.getConnectionTestTimeout
Resource adaptor config-property: ConnectionTestTimeout
Default: 10
Description:The number of seconds to wait between testing connections retrieved from the connection pool. Only valid when using the built-in Kodo connection pooling.
Property name: com.solarmetric.kodo.impl.jdbc.DefaultClassMappingClass
Configuration API: com.solarmetric.kodo.impl.jdbc.JDBCConfiguration.getDefaultClassMappingClass
Resource adaptor config-property: DefaultClassMappingClass
Default: com.solarmetric.kodo.impl.jbdc.ormapping.ClassMapping.
Description: The name of the default class to use for mapping persistent classes to the database. Must extend com.solarmetric.kodo.impl.jdbc.ormapping.ClassMapping .
Property name: com.solarmetric.kodo.impl.jdbc.DefaultSubclassProviderClass
Configuration API: com.solarmetric.kodo.impl.jdbc.JDBCConfiguration.getDefaultSubclassProviderClass
Resource adaptor config-property: DefaultSubclassProviderClass
Default: com.solarmetric.kodo.impl.jbdc.ormapping.SubclassProviderImpl. This implementation stores the full classname of each type stored into the database in the indicator column defined in the JDO metadata file.
Description: The name of the default class to use for managing subclass indicator columns. Must implement the com.solarmetric.kodo.impl.jdbc.ormapping.SubclassProvider interface. See custom class indicator documentation for more information about subclass providers.
Property name: com.solarmetric.kodo.impl.jdbc.DefaultSubclassProviderProperties
Configuration API: com.solarmetric.kodo.impl.jdbc.JDBCConfiguration.getDefaultSubclassProviderProperties
Resource adaptor config-property: DefaultSubclassProviderProperties
Default: none
Description: A space-separated list of properties to pass to the class defined in com.solarmetric.kodo.impl.jdbc.DefaultSubclassProviderClass upon initialization.
Property name: com.solarmetric.kodo.impl.jdbc.DictionaryClass
Configuration API: com.solarmetric.kodo.impl.jdbc.JDBCConfiguration.getDictionaryClass
Resource adaptor config-property: DictionaryClass
Default: based on javax.jdo.option.ConnectionURL
Description: The DBDictionary to use for this configuration. This is auto-detected based on the setting of javax.jdo.option.ConnectionURL, so you need only set this to override the default with your own custom DBDictionary or if you are using an unrecognized driver.
Unfortunately, minor differences in the way databases map java types to native SQL types and variances in the SQL syntax for manipulating database schema make it impossible to write persistence code that will work across all databases. To overcome this problem, SolarMetric has defined the com.solarmetric.kodo.impl.jdbc.schema.DBDictionary interface, which declares the API necessary to abstract away the idiosyncrasies of an individual database vendor. Each supported database has its own dictionary:
com.solarmetric.kodo.impl.jdbc.schema.dict.CloudscapeDictionary
com.solarmetric.kodo.impl.jdbc.schema.dict.InstantDBDictionary
com.solarmetric.kodo.impl.jdbc.schema.dict.PointbaseDictionary
com.solarmetric.kodo.impl.jdbc.schema.dict.PostgresDictionary
com.solarmetric.kodo.impl.jdbc.schema.dict.SQLServerDictionary
For databases without direct support, it is possible to implement a custom DBDictionary and plug it in using this property. To facilitate this process, SolarMetric provides the com.solarmetric.kodo.impl.jdbc.schema.dict.GenericDictionary, which implements the DBDictionary interface using standard SQL. Subclasses need override only those methods that represent operations for which a specific database differs from the standard. See the included Javadoc documentation for further information.
Property name: com.solarmetric.kodo.impl.jdbc.DictionaryProperties
Configuration API: com.solarmetric.kodo.impl.jdbc.JDBCConfiguration.getDictionaryProperties
Resource adaptor config-property: DictionaryProperties
Default: none
Description: A space-separated list of name-value properties settings to pass to the dictionary defined by com.solarmetric.kodo.impl.jdbc.DictionaryClass.
Many of the DBDictionary options are automatically configured by concrete subclasses of GenericDictionary. The defaults can, however, be overridden by using this property.
The GenericDictionary understands the following properties:
QuoteNumbers
Default: false
Description: If true, then numbers will be quoted before being stored. This improves precision for some data stores.
NameTruncationVersion
Default: 0
Description: If 0, then autogenerated table/column/index names that are longer than the maximum allowable lengths will be truncated using a readable truncation algorithm that can potentially cause collisions. If 1, then a more aggressive but less readable truncation algorithm will be used. This is useful for databases with small maximum lengths, such as DB2. For information on manually overriding Kodo JDO's schema name generation to avoid collisions, see the section on JDO metadata extensions.
SchemaName
Default: null
Description: The name of the schema to connect to when invoking java.sql.DatabaseMetaData methods that accept a schema name. This can be important when accessing a data store that has multiple schemas with JDO metadata tables in them.
IndexNameGenerator
Default: com.solarmetric.kodo.impl.jdbc.schema.DefaultNameGenerator
Description: The concrete implementation of the com.solarmetric.kodo.impl.jdbc.schema.NameGenerator interface, which controls how index names will be generated.
ColumnNameGenerator
Default: com.solarmetric.kodo.impl.jdbc.schema.DefaultNameGenerator
Description: The concrete implementation of the com.solarmetric.kodo.impl.jdbc.schema.NameGenerator interface, which controls how column names will be generated.
TableNameGenerator
Default: com.solarmetric.kodo.impl.jdbc.schema.DefaultNameGenerator
Description: The concrete implementation of the com.solarmetric.kodo.impl.jdbc.schema.NameGenerator interface, which controls how table names will be generated.
SimulateLocking
Default: false
Description: Some databases do not support pessimistic locking, which will result in a JDOException to be thrown when a datastore transaction is attempted. Setting this parameter to true will bypass this check, and allow a datastore transaction to occur even though the underlying database does not support them.
ValidateConnections
Default: true
Description: Many JDBC drivers do not actually validate the Connection when Connection.isClosed() is issued. When set to true, the dictionary will perform additional validation of a JDBC Connection when retrieving a Connection from the DataSource. This will typically take the form of the issuance of a small SQL statement (such as "SELECT SYSDATE FROM DUAL"). This helps to ensure that Connection instances retrieved from a connection pool are in a valid state.
ValidateConnectionSQL
Default: null
Description: A SQL statement to issue that a Connection instance is in a valid state.
StoreLargeNumbersAsStrings
Default: false
Description: Many databases have limitation on the number of digits can can be stored in a numeric field (for example, Oracle can only store 38 digits). For applications that may be operating on very large BigInteger and BigDecimal values, it may be necessary to store these objects as String fields rather than the database's numeric type. Note that this may prevent meaningful numeric queries from being executed against the database.
The MySQLDictionary understands the following properties:
TableType
Default: null
Description: The table type to use when creating new tables. For example, to create transaction-capable BDB tables, set this to BDB.
SupportsSelectForUpdate
Default: true
Description: If true, then assume that this MySQL install is capable of locking data on select, using SELECT ... FOR UPDATE syntax. Otherwise, assume that this MySQL install cannot lock data. Currently, Kodo JDO silently ignores requests to obtain pessimistic locks in this situation. In the future, Kodo JDO will throw an exception if configured with data store exceptions while this is false.
Property name: com.solarmetric.kodo.impl.jdbc.FlatInheritanceMapping
Configuration API: com.solarmetric.kodo.impl.jdbc.JDBCConfiguration.getFlatInheritanceMapping
Resource adaptor config-property: FlatInheritanceMapping
Default: true
Description: If true, then all fields of all classes in a given inheritance hierarchy will by default map into the least-derived type's default primary table. If false then a new default primary table will be created for each class in the inheritance hierarchy, and each type's declared fields will map to that table by default.
Property name: com.solarmetric.kodo.impl.jdbc.SequenceFactoryClass
Configuration API: com.solarmetric.kodo.impl.jdbc.JDBCConfiguration.getSequenceFactoryClass
Resource adaptor config-property: SequenceFactoryClass
Default: com.solarmetric.kodo.impl.jbdc.schema.DBSequenceFactory. This implementation obtains sequence numbers from a special database table used solely for this purpose. The table is created automatically the first time sequence numbers are requested if it does not already exist. The sequence table can also be manipulated through the included sequencetable shell/bat script, which accepts the same options as the schematool and uses the following actions:
add: Creates the sequence table if it does not already exist.
drop: Drops the sequence table.
increment: Increments the value of the sequence table by the increment defined for the SequenceFactory, and prints the new value. If the table does not exist, it will be created.
Description: The name of the class to use for generating sequence numbers when using data store identity. Must implement the com.solarmetric.kodo.impl.jdbc.SequenceFactory interface. Simple examples are included in the source directory of your Kodo Installation. In addition there is also com.solarmetric.kodo.impl.jdbc.schema.ClassDBSequenceFactory, which is a class-sensitive SequenceFactory. This takes the same options as DBSequenceFactory, as well as having a main (String []) to manipulate the factory.
Property name: com.solarmetric.kodo.impl.jdbc.SequenceFactoryProperties
Configuration API: com.solarmetric.kodo.impl.jdbc.JDBCConfiguration.getSequenceFactoryProperties
Resource adaptor config-property: SequenceFactoryProperties
Default: none
Description: A space-separated list of properties to pass to the class defined in com.solarmetric.kodo.impl.jdbc.SequenceFactoryClass upon initialization.
com.solarmetric.kodo.impl.jdbc.schema.DBSequenceFactory understands the following properties:
Increment
Default: 50
Description: The number by which the sequence table should be incremented. The sequence table is created automatically by Kodo JDO and used to generate unique object ID values. To increase performance, Kodo JDO grabs sequence numbers in blocks, so that it only has to consult the sequence table once every N new persistent instances. The default value for this property is 50.
TableName
Default: JDO_SEQUENCE
Description: The sequence table to look for the sequence values. The default value for this property is JDO_SEQUENCE. Note that tables names will go through the DBDictionary for their ultimate table name.
Property name: com.solarmetric.kodo.impl.jdbc.SQLExecutionManagerClass
Configuration API: com.solarmetric.kodo.impl.jdbc.JDBCConfiguration.getSQLExecutionManagerClass
Resource adaptor config-property: SQLExecutionManagerClass
Default: com.solarmetric.kodo.impl.jdbc.SQLExecutionManagerImpl
Description: The name of a custom SQLExecutionManager to be used for all issuance of SQL to the data store. Must implement com.solarmetric.kodo.impl.jdbc.SQLExecutionManager.
Property name: com.solarmetric.kodo.impl.jdbc.StatementCacheMaxSize
Configuration API: com.solarmetric.kodo.impl.jdbc.JDBCConfiguration.getStatementCacheMaxSize
Resource adaptor config-property: StatementCacheMaxSize
Default: 100
Description: The size of the PreparedStatement cache that is maintained in the DataSource implementation.
Property name: com.solarmetric.kodo.impl.jdbc.StatementExecutionTimeout
Configuration API: com.solarmetric.kodo.impl.jdbc.JDBCConfiguration.getStatementExecutionTimeout
Resource adaptor config-property: StatementExecutionTimeout
Default: -1
Description: The time, in seconds, after which a JDBC query will be aborted if it has not yet returned any values. This value is simply passed to the JDBC driver's Statement.setTimeout method; Kodo does not perform any addition timeout actions. Note that many JDBC drivers either ignore this request, or improperly handle it, which may result in application deadlocks.
Property name: com.solarmetric.kodo.impl.jdbc.SynchronizeSchema
Configuration API: com.solarmetric.kodo.impl.jdbc.JDBCConfiguration.getSynchronizeSchema
Resource adaptor config-property: SynchronizeSchema
Default: false
Description: If true, the Kodo runtime will automatically attempt to refresh the database schema when persistent classes are referenced, allowing the developer to bypass the schematool step.
![]() | Warning |
---|---|
This property is only intended to be used for development. As automatic schema migration can result in data loss, this feature should never be enabled on a production system. Furthermore, this feature has serious adverse affects on Kodo's runtime performace. Ensure that it is disabled before doing any performance analysis. |
Property name: com.solarmetric.kodo.impl.jdbc.TransactionIsolation
Configuration API: com.solarmetric.kodo.impl.jdbc.JDBCConfiguration.getTransactionIsolation
Resource adaptor config-property: TransactionIsolation
Default: none
Description: Typically, the default transaction isolation provided by a java.sql.Connection will be appropriate for an application. However, it is sometimes desirable to override the default transaction isolation. This property can be used to set the transaction isolation for every transactional connection that is made to the data store. Valid values are:
READ_COMMITTED: dirty reads are prevented; non-repeatable reads and phantom reads can occur
READ_UNCOMMITTED: dirty reads, non-repeatable reads and phantom reads can occur
REPEATABLE_READ: dirty reads and non-repeatable reads are prevented; phantom reads can occur
SERIALIZABLE: dirty reads, non-repeatable reads and phantom reads are prevented
Property name: com.solarmetric.kodo.impl.jdbc.UsePreparedStatements
Configuration API: com.solarmetric.kodo.impl.jdbc.JDBCConfiguration.getUsePreparedStatements
Resource adaptor config-property: UsePreparedStatements
Default: true
Description: Use a PreparedStatement for all SQL access.
Property name: com.solarmetric.kodo.impl.jdbc.UseBatchedStatements
Configuration API: com.solarmetric.kodo.impl.jdbc.JDBCConfiguration.getUseBatchedStatements
Resource adaptor config-property: UseBatchedStatements
Default: true (provided the underlying JDBC driver's method supportsBatchUpdates() returns true)
Description: Whenever possible, batch together similiar non-selecting SQL statements (INSERT/UPDATE/DELETE) for performance.
Property name: com.solarmetric.kodo.impl.jdbc.WarnOnPersistentTypeFailure
Configuration API: com.solarmetric.kodo.impl.jdbc.JDBCConfiguration.getWarnOnPersistentTypeFailure
Resource adaptor config-property: WarnOnPersistentTypeFailure
Default: false
Description: If true, then Kodo JDO will print a warning if an error occurs while loading one of the listed persistent types. Otherwise, Kodo JDO will fail when such an error occurs. This can be useful when developing in a multi-user environment, when the schema may be slightly out-of-sync. However, this option should not be used at deploy time, since at deploy time, any problem loading a listed persistent type is probably a big deal.
Property name: com.solarmetric.kodo.ee.ManagedRuntimeClass
Configuration API: com.solarmetric.kodo.ee.EEConfiguration.getManagedRuntimeClass
Resource adaptor config-property: ManagedRuntimeClass
Default: com.solarmetric.kodo.ee.JNDIManagedRuntime
Description: The name of the class to use for obtaining a reference to the transaction manager in an enterprise environment. Must implement the com.solarmetric.kodo.ee.ManagedRuntime interface.
Property name: com.solarmetric.kodo.ee.ManagedRuntimeProperties
Configuration API: com.solarmetric.kodo.ee.EEConfiguration.getManagedRuntimeProperties
Resource adaptor config-property: ManagedRuntimeProperties
Default: none
Description: A space-separated list of properties to pass to the class defined in com.solarmetric.kodo.ManagedRuntimeClass upon initialization.
com.solarmetric.kodo.ee.JNDIManagedRuntime understands the following property:
TransactionManagerName
Default: java:/TransactionManager
Description: The location in JNDI of the javax.transaction.TransactionManager to use to synchronize with a global transaction.