JPOX
JPOX
 JPOX Version 1.0
Configuration | Tutorials | Worked Examples | Developer
Obtaining JPOX
JPOX Preparation
JPOX Runtime
Configuration

Java Persistent Objects JDO (JPOX) allows a level of runtime configuration. This configuration is typically specified in a jpox.properties file, and consists of two types of parameters - standard ones for JDO, and vendor-extensions for JPOX. These are all detailed below.

Standard JDO Properties
ParameterDefaultDescription
javax.jdo.PersistenceManagerFactoryClass(org.jpox.PersistenceManagerFactoryImpl)The name of the PersistenceManager implementation
javax.jdo.option.ConnectionDriverName(none)The name of the (JDBC) driver to use for the DB
javax.jdo.option.ConnectionURL(none)URL specifying the database to use for persistence
javax.jdo.option.ConnectionUserName(none)Username to use for connecting to the DB
javax.jdo.option.ConnectionPassword(none)Password to use for connecting to the DB
javax.jdo.option.IgnoreCache(none)Whether to ignore the cache for queries
javax.jdo.option.Multithreaded(none)Whether to run the PersistenceManager multithreaded
javax.jdo.option.NontransactionalRead(none)Whether to allow nontransactional reads
javax.jdo.option.NontransactionalWrite(none)Whether to allow nontransactional writes
javax.jdo.option.Optimistic(none)Whether to use Optimistic transactions
javax.jdo.option.RetainValues(none)Whether to suppress automatic eviction of persistent instances on transaction completion
javax.jdo.option.RestoreValues(none)Whether persistent object have transactional field values restored when transaction rollback occurs.


Extended JPOX Properties
org.jpox.rdbms.CheckExistTablesOrViews
DescriptionWhether to check if the table/view exists. If false, it disables the automatically generation of tables that don't exist.
Range of Valuestrue | false


org.jpox.validateTables
DescriptionWhether to validate tables against the persistence definition. Please refer to the Schema Guide for more details.
Range of Valuestrue | false


org.jpox.validateConstraints
DescriptionWhether to validate table constraints against the persistence definition. Please refer to the Schema Guide for more details.
Range of Valuestrue | false


org.jpox.autoCreateSchema
DescriptionWhether to automatically generate any tables and constraints that don't exist. Please refer to the Schema Guide for more details.
Range of Valuestrue | false
Since1.0.0-beta-4


org.jpox.autoCreateTables
DescriptionWhether to automatically generate any tables that don't exist. Please refer to the Schema Guide for more details.
Range of Valuestrue | false


org.jpox.autoCreateConstraints
DescriptionWhether to automatically generate any constraints that don't exist. Please refer to the Schema Guide for more details.
Range of Valuestrue | false
Since1.0.0-beta-4


org.jpox.store.Dictionary.CaseIdentifier
DescriptionWhich case to use in table and column names.
Range of ValuesUpperCase | LowerCase | SentenceCase | CapitalizeCase | PreserveCase
Since1.0.0-beta-3


org.jpox.identifier.defaultSchemaName
DescriptionWhere your user has a different default schema to what you want JPOX to use you should specify a default schema for JPOX to use. JPOX will then prefix all table names with this schema name in any DDL/SQL.
Since1.0.3


org.jpox.identifier.fullyQualifiedNames
DescriptionWhen you access a table in the database, you can choose to use whether simple table names or fully qualified table names, like DB_NAME.TABLE_OWNER_NAME.TABLE_NAME. You can enable or disable fully qualified names by setting true or false.
Range of Valuestrue | false
Since1.0.0-beta-4


org.jpox.transactionIsolation
DescriptionSelect the default JDBC transaction isolation level for ALL PersistenceManager factories - case insensitive, and spaces/underscores are treated the same. Some databases do not support all isolation levels, refer to your database documentation.
Range of ValuesREAD_UNCOMMITTED | READ_COMMITTED | REPEATABLE_READ | SERIALIZABLE


org.jpox.cache.jdoinstances.plugin
DescriptionA cache plugin class implements the interface org.jpox.CachePlugin. It's an extension point for using external cache products.
Range of Valuesthe class name


org.jpox.cache.jdoinstances.group
DescriptionA name for the group in which PersistenceManager instances will share a cache of persistent objects with other PersistenceManager instances allocated to the same group.
Default valueNone. The persistent objects are not shared between different PersistenceManagers.
Range of ValuesAny String


org.jpox.poid.generatorClass
DescriptionThe class generator which generates unique identifiers for objects.
Default valueSee Identity Generation
Range of ValuesSee Identity Generation


org.jpox.poid.transactionAttribute
DescriptionWhether to use the PM connection or open a new connection.
Default valueNew
Range of ValuesUsePM | New


org.jpox.store.maxRetries
Description
Default value3
Range of ValuesA positive integer


org.jpox.store.adapter.OracleAdapter
DescriptionClass used for Oracle DB adapter


org.jpox.oracle.nlsSortOrder
DescriptionSort order for Oracle String fields in queries (BINARY disables native language sorting)
Default valueLATIN
Range of ValuesSee Oracle documentation


org.jpox.useUpdateLock
DescriptionWhether JPOX should use 'SELECT ... FOR UPDATE' on all fetch operations to prevent dirty writes. Only applies to read committed and read uncommitted transaction isolation level.
Range of Valuestrue | false


org.jpox.defaultMaxStringLength
DescriptionThe user can choose to specify the length of any strings in terms of how they are stored in the datastore. So for example they can specify a Meta-Data extension tag so the string has a max length of 255 for example. If the user doesn't use that option JPOX will impose a maximum length on the string and this parameter allows the user to control the maximum default length. If they don't specify this parameter or the extension tag, they will get strings of maximum length 127.
Default value127
Since1.0.0-beta-1


org.jpox.autoStartMechanism
DescriptionHow to initialise JPOX at startup. This allows JPOX to read in from some source the classes that it was persisting for this data store the previous time. "SchemaTable" stores a table in the RDBMS for this purpose. The only other option at present is "None" (start from scratch each time). Please refer to the Schema Guide for more details.
Range of ValuesSchemaTable | None
Since1.0.0-beta-1


org.jpox.autoStartMechanismMode
DescriptionThe mode of operation of the auto start mode. Currently there are 3 values. "Quiet" means that at startup if any errors are encountered, they are fixed quietly. "Ignored" means that at startup if any errors are encountered they are just ignored. "Checked" means that at startup if any errors are encountered they are thrown as exceptions.
Range of valuesChecked | Ignored | Quiet
Since1.0.0-beta-4


org.jpox.delayDatastoreOperationsUntilCommit
DescriptionWhether the datastore operations are delayed until commit. Possible values are true or false.
Range of valuestrue | false
Since1.0.0-beta-4


Examples : Standalone Environment

When running a stand-alone application (not within a J2EE environment), you would typically specify properties as in the following example

javax.jdo.PersistenceManagerFactoryClass=org.jpox.PersistenceManagerFactoryImpl
javax.jdo.option.ConnectionDriverName=com.mysql.jdbc.Driver
javax.jdo.option.ConnectionURL=jdbc:mysql://localhost/myDB
org.jpox.autoCreateSchema=true

So in this case we have a MySQL datastore, with the database called "myDB", and we want JPOX to automatically create any tables that are needed.



Examples : J2EE Environment

JPOX provides a driver adaptor that enables you to take all advantages of using a database connection pool available on an application server. To make use of it, set up the following:

Running in a managed context:

javax.jdo.PersistenceManagerFactoryClass=org.jpox.PersistenceManagerFactoryImpl
javax.jdo.option.ConnectionDriverName=org.jpox.driver.JPOXDriver
javax.jdo.option.ConnectionURL=jpox:myJndiDataSource

Running in a non-managed context:

javax.jdo.PersistenceManagerFactoryClass=org.jpox.PersistenceManagerFactoryImpl
javax.jdo.option.ConnectionDriverName=org.jpox.driver.JPOXDriver
javax.jdo.option.ConnectionURL=jpox:java:comp/env/myJndiDataSource