2.2. Kodo JDO Properties

2.2.1. com.solarmetric.kodo.CacheReferenceSize
2.2.2. com.solarmetric.kodo.ConnectionProperties
2.2.3. com.solarmetric.kodo.DataCacheClass
2.2.4. com.solarmetric.kodo.DataCacheProperties
2.2.5. com.solarmetric.kodo.RemoteCommitProviderClass
2.2.6. com.solarmetric.kodo.RemoteCommitProviderProperties
2.2.7. com.solarmetric.kodo.DefaultDataCacheTimeout
2.2.8. com.solarmetric.kodo.DefaultFetchThreshold
2.2.9. com.solarmetric.kodo.DefaultFetchBatchSize
2.2.10. com.solarmetric.kodo.EnableQueryExtensions
2.2.11. com.solarmetric.kodo.FetchGroups
2.2.12. com.solarmetric.kodo.FlushBeforeQueries
2.2.13. com.solarmetric.kodo.LicenseKey
2.2.14. com.solarmetric.kodo.PersistenceManagerClass
2.2.15. com.solarmetric.kodo.PersistenceManagerProperties
2.2.16. com.solarmetric.kodo.ProxyManagerClass
2.2.17. com.solarmetric.kodo.ProxyManagerProperties
2.2.18. com.solarmetric.kodo.QueryCacheClass
2.2.19. com.solarmetric.kodo.QueryCacheProperties
2.2.20. com.solarmetric.kodo.QueryFilterListeners
2.2.21. com.solarmetric.kodo.ResultListClass
2.2.22. com.solarmetric.kodo.ResultListProperties
2.2.23. com.solarmetric.kodo.TransactionCacheClass
2.2.24. com.solarmetric.kodo.TransactionCacheProperties
2.2.25. com.solarmetric.kodo.UseSoftTransactionCache
2.2.26. com.solarmetric.kodo.PersistentTypes
2.2.27. com.solarmetric.kodo.TransactionMode
2.2.28. com.solarmetric.kodo.ConnectionFactory2Properties
2.2.29. com.solarmetric.kodo.impl.jdbc.ConnectionRetainMode
2.2.30. com.solarmetric.kodo.impl.jdbc.ConnectionTestTimeout
2.2.31. com.solarmetric.kodo.impl.jdbc.DefaultClassMappingClass
2.2.32. com.solarmetric.kodo.impl.jdbc.DefaultSubclassProviderClass
2.2.33. com.solarmetric.kodo.impl.jdbc.DefaultSubclassProviderProperties
2.2.34. com.solarmetric.kodo.impl.jdbc.DictionaryClass
2.2.35. com.solarmetric.kodo.impl.jdbc.DictionaryProperties
2.2.36. com.solarmetric.kodo.impl.jdbc.FlatInheritanceMapping
2.2.37. com.solarmetric.kodo.impl.jdbc.SequenceFactoryClass
2.2.38. com.solarmetric.kodo.impl.jdbc.SequenceFactoryProperties
2.2.39. com.solarmetric.kodo.impl.jdbc.SQLExecutionManagerClass
2.2.40. com.solarmetric.kodo.impl.jdbc.SQLExecutionListenerClass
2.2.41. com.solarmetric.kodo.impl.jdbc.StatementCacheMaxSize
2.2.42. com.solarmetric.kodo.impl.jdbc.StatementExecutionTimeout
2.2.43. com.solarmetric.kodo.impl.jdbc.SynchronizeSchema
2.2.44. com.solarmetric.kodo.impl.jdbc.TransactionIsolation
2.2.45. com.solarmetric.kodo.impl.jdbc.UseBatchedStatements
2.2.46. com.solarmetric.kodo.impl.jdbc.UseSQL92Joins
2.2.47. com.solarmetric.kodo.impl.jdbc.WarnOnPersistentTypeFailure
2.2.48. com.solarmetric.kodo.ee.ManagedRuntimeClass
2.2.49. com.solarmetric.kodo.ee.ManagedRuntimeProperties

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.

2.2.1. com.solarmetric.kodo.CacheReferenceSize

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.

2.2.2. com.solarmetric.kodo.ConnectionProperties

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

2.2.3. com.solarmetric.kodo.DataCacheClass

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.

2.2.4. com.solarmetric.kodo.DataCacheProperties

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.

2.2.5. com.solarmetric.kodo.RemoteCommitProviderClass

Property name: com.solarmetric.kodo.RemoteCommitProviderClass

Configuration API: com.solarmetric.kodo.conf.Configuration.getRemoteCommitProviderClass

Resource adaptor config-property: RemoteCommitProviderClass

Default: none

Description: The name of the class to use for communicating commit information among JVMs. Must implement com.solarmetric.kodo.runtime.event.RemoteCommitProvider.

2.2.6. com.solarmetric.kodo.RemoteCommitProviderProperties

Property name: com.solarmetric.kodo.RemoteCommitProviderProperties

Configuration API: com.solarmetric.kodo.conf.Configuration.getRemoteCommitProviderProperties

Resource adaptor config-property: RemoteCommitProviderProperties

Default: none

Description: A space-separated list of properties to pass to the class defined in com.solarmetric.kodo.RemoteCommitProviderClass upon initialization.

2.2.7. com.solarmetric.kodo.DefaultDataCacheTimeout

Property name: com.solarmetric.kodo.DefaultDataCacheTimeout

Configuration API: com.solarmetric.kodo.conf.Configuration.getDefaultDataCacheTimeout

Resource adaptor config-property: DefaultDataCacheTimeout

Default: 0.0

Description: The number of seconds that data in the data cache is valid for. A value of 0 or less means that by default, cached data does not time out.

2.2.8. com.solarmetric.kodo.DefaultFetchThreshold

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.

2.2.9. com.solarmetric.kodo.DefaultFetchBatchSize

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.

2.2.10. com.solarmetric.kodo.EnableQueryExtensions

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.

2.2.11. com.solarmetric.kodo.FetchGroups

Property name: com.solarmetric.kodo.FetchGroups

Configuration API: com.solarmetric.kodo.conf.Configuration.getFetchGroups

Resource adaptor config-property: FetchGroups

Default: none

Description: A comma-separated list of fetch group names that are to be loaded when loading objects from a data store.

2.2.12. com.solarmetric.kodo.FlushBeforeQueries

Property name: com.solarmetric.kodo.FlushBeforeQueries

Configuration API: com.solarmetric.kodo.conf.Configuration.getFlushBeforeQueries

Resource adaptor config-property: FlushBeforeQueries

Default: with-connection

Possible values:

  • true

  • false

  • with-connection

Description: Controls whether or not Kodo should automatically flush modifications to the data store before executing queries. Kodo will only flush modifications if javax.jdo.option.IgnoreCache is set to false (not the default) and this property is set to true or with-connection and Kodo detects that the changes made in the current transaction may be involved in the query to be executed.

If FlushBeforeQueries is set to with-connection, then Kodo will only automatically flush if the current PersistenceManager already has a reference to a connection. This means that Kodo will sacrifice query performance in order to not obtain dedicated resources. This option is useful if you use long-lived optimistic transactions and want to ensure that these long-lived transactions will not consume database resources for the life cycle of the transaction. The behavior of Kodo when with-connection is used is dependent upon the current transactional mode and the setting of ConnectionRetainMode.

If IgnoreCache is false, Kodo detects that there may be modifications, and this property is set to false, Kodo will perform queries in-memory.

Below is a table describing the behavior of automatic flushing in various different situations. In all these situations, flushing will only occur if Kodo detects that you have made modifications in the current transaction to instances of types that are in the current query's access path.

Table 2.1. Kodo Automatic Flush Behavior

 FlushBeforeQueries = falseFlushBeforeQueries = trueFlushBeforeQueries = with-connection; ConnectionRetainMode = on-demandFlushBeforeQueries = with-connection; ConnectionRetainMode = transaction or persistence-manager
IgnoreCache = trueno flushno flushno flushno flush
IgnoreCache = false; no tx activeno flushno flushno flushno flush
IgnoreCache = false; datastore tx activeno flushflushflushflush
IgnoreCache = false; optimistic tx activeno flushflushno flush unless flush() has already been invokedflush

2.2.13. com.solarmetric.kodo.LicenseKey

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

2.2.14. com.solarmetric.kodo.PersistenceManagerClass

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.

2.2.15. com.solarmetric.kodo.PersistenceManagerProperties

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.

2.2.16. com.solarmetric.kodo.ProxyManagerClass

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.

2.2.17. com.solarmetric.kodo.ProxyManagerProperties

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.

2.2.18. com.solarmetric.kodo.QueryCacheClass

Property name: com.solarmetric.kodo.QueryCacheClass

Configuration API: com.solarmetric.kodo.conf.Configuration.getQueryCacheClass

Resource adaptor config-property: QueryCacheClass

Default: none

Description: The name of the class to use for caching of queries loaded from the data store. Must implement com.solarmetric.kodo.runtime.datacache.QueryCache.

2.2.19. com.solarmetric.kodo.QueryCacheProperties

Property name: com.solarmetric.kodo.QueryCacheProperties

Configuration API: com.solarmetric.kodo.conf.Configuration.getQueryCacheProperties

Resource adaptor config-property: QueryCacheProperties

Default: none

Description: A space-separated list of properties to pass to the class defined in com.solarmetric.kodo.QueryCacheClass upon initialization. See the caching documentation for details on possible values.

2.2.20. com.solarmetric.kodo.QueryFilterListeners

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.

2.2.21. com.solarmetric.kodo.ResultListClass

Property name: com.solarmetric.kodo.ResultListClass

Configuration API: com.solarmetric.kodo.conf.Configuration.getResultListClass

Resource adaptor config-property: ResultListClass

Default: none

Description: The name of the class to use as the List implementation that holds Query results. By default, this value will be dependant on whether the JDBC driver supports scrollable cursors, but can be overridden by expicitely setting this property. The class must implement the com.solarmetric.kodo.runtime.objectprovider.CustomResultList interface. The following built-in implementations are available:

  • com.solarmetric.kodo.runtime.objectprovider.EagerResultList: This implementation will instantiate all the results immediately, and free the underlying datastore resource. This is the default that will be used when the underlying JDBC driver does not support scrolling ResultSets.

  • com.solarmetric.kodo.runtime.objectprovider.OnDemandForwardResultList: This implementation is never used by default. It can be used when scrolling ResultSets incur a large performance penalty, but support for large ResultSets is still desired. It instantiates requested elements on demand in a forward-only fashion. If the UseWindow configuration property is set to true in the com.solarmetric.kodo.ResultListProperties property, then the list will only hold onto a window-full of references to objects, and will drop references to any lower indices in the list. The window size is defined by the fetch batch size setting of the PersistenceManager when the list is created.

    [Warning]Warning

    Since this ResultList implementation is instantiated in a forward-only fashion, the size of the Collection will be reported incorrectly until the all of the results have been completely instantiated. This can lead to problems with code that relies on the correct size of a Collection, including many of the contracts defined by the java.util.Collection interface. Until the results are completely instantiated, the result of OnDemandForwardResultList.size() will be java.lang.Integer.MAX_VALUE.

  • com.solarmetric.kodo.impl.jdbc.runtime.LazyResultList: This implementation will keep open the datastore resource in order to provide random access to potentially large result lists. It is used by default when the JDBC driver supports scrolling ResultSets.

2.2.22. com.solarmetric.kodo.ResultListProperties

Property name: com.solarmetric.kodo.ResultListProperties

Configuration API: com.solarmetric.kodo.conf.Configuration.getResultListProperties

Resource adaptor config-property: ResultListProperties

Default: none

Description: A space-separated list of properties to pass to the class defined in com.solarmetric.kodo.ResultListClass upon initialization.

2.2.23. com.solarmetric.kodo.TransactionCacheClass

Property name: com.solarmetric.kodo.TransactionCacheClass

Configuration API: com.solarmetric.kodo.conf.Configuration.getTransactionCacheClass

Resource adaptor config-property: TransactionCacheClass

Default: com.solarmetric.kodo.runtime.FifoStateManagerSet

Description: The name of the class to use to store persistence-capable objects involved in a transaction. Must implement com.solarmetric.kodo.runtime.StateManagerSet. See the StateManagerSet documentation for possible values.

2.2.24. com.solarmetric.kodo.TransactionCacheProperties

Property name: com.solarmetric.kodo.TransactionCacheProperties

Configuration API: com.solarmetric.kodo.conf.Configuration.getTransactionCacheProperties

Resource adaptor config-property: TransactionCacheProperties

Default: none

Description: A space-separated list of properties to pass to the class defined in com.solarmetric.kodo.TransactionCacheClass upon initialization.

2.2.25. com.solarmetric.kodo.UseSoftTransactionCache

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.

2.2.26. com.solarmetric.kodo.PersistentTypes

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.

2.2.27. com.solarmetric.kodo.TransactionMode

Property name: com.solarmetric.kodo.TransactionMode

Configuration API: com.solarmetric.kodo.conf.Configuration.getTransactionMode

Resource adaptor config-property: TransactionMode

Default: direct

Description: When set to "xa", the PersistenceManager will not pass commit() requests directly to the data store, but will allow the current XA-compliant global transaction to handle the commit. This should only be used in managed environments where XADataSources are being used.

2.2.28. com.solarmetric.kodo.ConnectionFactory2Properties

Property name: com.solarmetric.kodo.ConnectionFactory2Properties

Configuration API: com.solarmetric.kodo.conf.Configuration.getConnectionFactory2Properties

Resource adaptor config-property: ConnectionFactory2Properties

Default: none

Description: Enables the configuration of a ConnectionFactory2 without binding it into JNDI. A space-separated list of bean setters for the com.solarmetric.kodo.impl.jdbc.ConnectionFactoryConfiguration instance to configure the ConnectionFactory2, which is used for obtaining datastore identities.

Example 2.3. Specifying ConnectionFactory2 Properties

com.solarmetric.kodo.ConnectionFactory2Properties: \
  ConnectionURL=jdbc:oracle:thin:@DBHOST:1521:DBNAME \
  ConnectionDriverName=oracle.jdbc.driver.OracleDriver \
  ConnectionUserName=USER \
  ConnectionPassword=PASS

2.2.29. com.solarmetric.kodo.impl.jdbc.ConnectionRetainMode

Property name: com.solarmetric.kodo.impl.jdbc.ConnectionRetainMode

Configuration API: com.solarmetric.kodo.impl.jdbc.JDBCConfiguration.getConnectionRetainMode

Resource adaptor config-property: ConnectionRetainMode

Default:on-demand

Description:Controls the association between a PersistenceManager and a JDBC Connection. Possible values:

  • on-demand: obtain connections as necessary, releasing them as soon as they are no longer needed. When using pessimistic transactions, connections are held for the duration of transactions, so that locks can be obtained correctly -- the behavior is the same as if transaction had been used. If a request for a connection is made while a connection is in use, the same connection will be returned, and an internal reference counter will be incremented. This means that a PM will never use more than one connection (ignoring any connections used by the SequenceFactory). This behavior differs from pre-2.5.3 versions of Kodo. If the old-style on-demand connection retain mode is needed, consider using the legacy-on-demand mode (see below).

  • transaction: obtain connections on a per-transaction basis. That is, a connection is obtained and used for the duration of each transaction. Nontransactional database accesses will obtain connections on-demand.

  • persistence-manager: obtain connections on a per-PersistenceManager basis, releasing them when the PersistenceManager is closed. All database accesses will use the same connection.

  • legacy-on-demand: just like on-demand, except that if multiple nested requests for a connection occur, multiple connections will be fetched from the pool. This is inefficient, and can possibly result in race conditions if the pool size is sufficiently small. This setting should therefore be avoided, and it is likely that this setting will be removed in a future release of Kodo.

2.2.30. com.solarmetric.kodo.impl.jdbc.ConnectionTestTimeout

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.

2.2.31. com.solarmetric.kodo.impl.jdbc.DefaultClassMappingClass

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 .

2.2.32. com.solarmetric.kodo.impl.jdbc.DefaultSubclassProviderClass

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.

2.2.33. com.solarmetric.kodo.impl.jdbc.DefaultSubclassProviderProperties

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.

2.2.34. com.solarmetric.kodo.impl.jdbc.DictionaryClass

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:

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.

2.2.35. com.solarmetric.kodo.impl.jdbc.DictionaryProperties

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.

2.2.36. com.solarmetric.kodo.impl.jdbc.FlatInheritanceMapping

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.

2.2.37. com.solarmetric.kodo.impl.jdbc.SequenceFactoryClass

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 when the schematool is run.

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. Possible values:

2.2.38. com.solarmetric.kodo.impl.jdbc.SequenceFactoryProperties

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.

2.2.39. com.solarmetric.kodo.impl.jdbc.SQLExecutionManagerClass

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.

2.2.40. com.solarmetric.kodo.impl.jdbc.SQLExecutionListenerClass

Property name: com.solarmetric.kodo.impl.jdbc.SQLExecutionListenerClass

Configuration API: com.solarmetric.kodo.impl.jdbc.JDBCConfiguration.getSQLExecutionListenerClass

Resource adaptor config-property: SQLExecutionListenerClass

Default: none

Description: A single implementation that will be installed as a custom SQLExecutionListener to listen to all JDBC activity. com.solarmetric.kodo.impl.jdbc.SQLExecutionListener.

2.2.41. com.solarmetric.kodo.impl.jdbc.StatementCacheMaxSize

Property name: com.solarmetric.kodo.impl.jdbc.StatementCacheMaxSize

Configuration API: com.solarmetric.kodo.impl.jdbc.JDBCConfiguration.getStatementCacheMaxSize

Resource adaptor config-property: StatementCacheMaxSize

Default: 70

Description: The size of the PreparedStatement cache that is maintained in the DataSource implementation. This value is global to the data source, rather than per-connection.

2.2.42. com.solarmetric.kodo.impl.jdbc.StatementExecutionTimeout

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.

2.2.43. com.solarmetric.kodo.impl.jdbc.SynchronizeSchema

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]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.

2.2.44. com.solarmetric.kodo.impl.jdbc.TransactionIsolation

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

2.2.45. com.solarmetric.kodo.impl.jdbc.UseBatchedStatements

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.

2.2.46. com.solarmetric.kodo.impl.jdbc.UseSQL92Joins

Property name: com.solarmetric.kodo.impl.jdbc.UseSQL92Joins

Configuration API: com.solarmetric.kodo.impl.jdbc.JDBCConfiguration.getUseSQL92Joins

Resource adaptor config-property: UseSQL92Joins

Default: database

Description: Set this property to true to make queries use SQL 92-style joins, including left outer joins where appropriate. Note that some databases do not support the SQL 92 standard, but do have a native outer join syntax. For these databases, set the value of this property to database. For databases that only support traditional joins, set this property to false. This property can also be set on a query-by-query basis; see the com.solarmetric.kodo.impl.jdbc.query.JDBCQuery Javadoc for details.

2.2.47. com.solarmetric.kodo.impl.jdbc.WarnOnPersistentTypeFailure

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.

2.2.48. com.solarmetric.kodo.ee.ManagedRuntimeClass

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.

2.2.49. com.solarmetric.kodo.ee.ManagedRuntimeProperties

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.