RDBMS Persistence Properties

DataNucleus accepts a large number of persistence properties for use when defining either a PersistenceManagerFactory or an EntityManagerFactory . For RDBMS datastores there are several additional properties. These are listed here. Bear in mind that these only work with DataNucleus, and not with any other JDO/JPA implementation.

datanucleus.rdbms.datastoreAdapterClassName
Description This property allows you to supply the class name of the adapter to use for your datastore. The default is not to specify this property and DataNucleus will autodetect the datastore type and use its own internal datastore adapter classes. This allows you to override the default behaviour where there maybe is some issue with the default adapter class.
Range of Values (valid class name on the CLASSPATH)


datanucleus.rdbms.statementBatchLimit
Description Maximum number of statements that can be batched. The default is 50 and also applies to delete of objects. Please refer to the Statement Batching guide
Range of Values integer value (0 = no batching)


datanucleus.rdbms.checkExistTablesOrViews
Description Whether to check if the table/view exists. If false, it disables the automatic generation of tables that don't exist.
Range of Values true | false


datanucleus.rdbms.initializeColumnInfo
Description Allows control over what column information is initialised when a table is loaded for the first time. By default info for all columns will be loaded. Unfortunately some RDBMS are particularly poor at returning this information so we allow reduced forms to just load the primary key column info, or not to load any.
Range of Values ALL | PK | NONE


datanucleus.rdbms.classAdditionMaxRetries
Description The maximum number of retries when trying to find a class to persist or when validating a class.
Range of Values 3 | A positive integer


datanucleus.rdbms.constraintCreateMode
Description How to determine the RDBMS constraints to be created. DataNucleus will automatically add foreign-keys/indices to handle all relationships, and will utilise the specified MetaData foreign-key information. JDO2 will only use the information in the MetaData file(s).
Range of Values DataNucleus | JDO2


datanucleus.rdbms.uniqueConstraints.mapInverse
Description Whether to add unique constraints to the element table for a map inverse field. Possible values are true or false.
Range of values true | false


datanucleus.rdbms.discriminatorPerSubclassTable
Description Property that controls if only the base class where the discriminator is defined will have a discriminator column
Range of values false | true
datanucleus.rdbms.useUpdateLock
Description Whether DataNucleus should use 'SELECT ... FOR UPDATE' on all fetch operations to prevent dirty writes. Only applies to read committed and read uncommitted transaction isolation level and doesn't apply to Optimistic Transactions. Please refer to the Transaction Types Guide for JDO and JPA
Range of Values true | false
datanucleus.rdbms.stringDefaultLength
Description The default (max) length to use for all strings that don't have their column length defined in MetaData.
Range of Values 256 (JDO) | 255 (JPA) | A valid length


datanucleus.rdbms.stringLengthExceededAction
Description Defines what happens when persisting a String field and its length exceeds the length of the underlying datastore column. The default is to throw an Exception. The other option is to truncate the String to the length of the datastore column.
Range of Values EXCEPTION | TRUNCATE


datanucleus.rdbms.persistEmptyStringAsNull
Description When persisting en empty string, should it be persisted as null in the datastore. This is to allow for datastores (Oracle) that dont differentiate between null and empty string. If it is set to false and the datastore doesnt differentiate then a special character will be saved when storing an empty string.
Range of Values true | false
datanucleus.rdbms.query.fetchDirection
Description The direction in which the query results will be navigated.
Range of Values forward | reverse | unknown


datanucleus.rdbms.query.resultSetType
Description Type of ResultSet to create. Note 1) Not all JDBC drivers accept all options. The values correspond directly to the ResultSet options. Note 2) Not all java.util.List operations are available for scrolling result sets. An Exception is raised when unsupported operations are invoked.
Range of Values forward-only | scroll-sensitive | scroll-insensitive


datanucleus.rdbms.query.resultSetConcurrency
Description Whether the ResultSet is readonly or can be updated. Not all JDBC drivers support all options. The values correspond directly to the ResultSet options.
Range of Values read-only | updateable


datanucleus.rdbms.jdoql.joinType
Description When running a JDOQL query, this defines what type of joins DataNucleus should try to use overriding the natural choice for the query. In some situations the user may know that it should use "INNER", or "LEFT OUTER" joins only.
Range of Values INNER | LEFT OUTER


datanucleus.rdbms.jdoql.existsIncludesConstraints
Description When a JDOQL query has a "contains" clause this will be replaced by an EXISTS sub-query. This property defines whether all other clauses should be applied to this sub-query, instead of the parent query. In some cases this will lead to inefficient queries.
Range of Values true | false


datanucleus.rdbms.oracleNlsSortOrder
Description Sort order for Oracle String fields in queries (BINARY disables native language sorting)
Range of Values LATIN | See Oracle documentation


datanucleus.rdbms.schemaTable.tableName
Description Name of the table to use when using auto-start mechanism of "SchemaTable" Please refer to the RDBMS Auto-Start guide
Range of Values NUCLEUS_TABLES | Valid table name


datanucleus.rdbms.connectionProviderName
Description Name of the connection provider to use to allow failover Please refer to the Failover guide
Range of Values PriorityList | Name of a provider


datanucleus.rdbms.connectionProviderFailOnError
Description Whether to fail if an error occurs, or try to continue and log warnings
Range of Values true | false


datanucleus.rdbms.dynamicSchemaUpdates
Description Whether to allow dynamic updates to the schema. This means that upon each insert/update the types of objects will be tested and any previously unknown implementations of interfaces will be added to the existing schema.
Range of Values true | false


datanucleus.rdbms.omitDatabaseMetaDataGetColumns
Description Whether to bypass all calls to DatabaseMetaData.getColumns(). This JDBC method is called to get schema information, but on some JDBC drivers (e.g Derby) it can take an inordinate amout of time. Setting this to true means that your datastore schema has to be correct and no checks will be performed.
Range of Values true | false


datanucleus.rdbms.sqlTableNamingStrategy
Description Name of the plugin to use for defining the names of the aliases of tables in SQL statements. This doesn't currently apply to JDOQL statements but will by version 1.2
Range of Values alpha-scheme | t-scheme


datanucleus.rdbms.request.insert
Description Name of plugin to use for inserts. See plugin point "org.datanucleus.store.rdbms.rdbms_request"
Range of Values default


datanucleus.rdbms.request.update
Description Name of plugin to use for updates. See plugin point "org.datanucleus.store.rdbms.rdbms_request"
Range of Values default


datanucleus.rdbms.request.delete
Description Name of plugin to use for deletes. See plugin point "org.datanucleus.store.rdbms.rdbms_request"
Range of Values default


datanucleus.rdbms.request.fetch
Description Name of plugin to use for fetches of fields. See plugin point "org.datanucleus.store.rdbms.rdbms_request"
Range of Values default


datanucleus.rdbms.request.locate
Description Name of plugin to use for locate of objects. See plugin point "org.datanucleus.store.rdbms.rdbms_request"
Range of Values default


datanucleus.rdbms.tableColumnOrder
Description How we should order the columns in a table. The default is to put the fields of the owning class first, followed by superclasses, then subclasses. An alternative is to start from the base superclass first, working down to the owner, then the subclasses
Range of Values owner-first | superclass-first


datanucleus.rdbms.allowColumnReuse
Description This property allows you to reuse columns for more than 1 field of a class. It is false by default to protect the user from erroneously typing in a column name. Only from 2.1.3 onwards
Range of Values true | false


datanucleus.rdbms.sqlParamValuesInBrackets
Description Whether we should log the SQL parameter values in angle brackets or not. This defaults to true so we can distinguish what is a property, but if you turn it off you see what is the SQL you could use in an SQL console.
Range of Values true | false


datanucleus.rdbms.fetchUnloadedAutomatically
Description If enabled will, upon a request to load a field, check for any unloaded fields that are non-relation fields or 1-1/N-1 fields and will load them in the same SQL call.
Range of Values true | false