Chapter 6 - Configuration

The ObjectDB configuration file contains one <objectdb> root element with seven subelements:

<objectdb>
  <general> ... </general>
  <database> ... </database>
  <entities>  ... </entities>
  <schema> ... </schema>
  <server> ... </server>
  <users> ... </users>
  <ssl> ... </ssl>
</objectdb>

Each one of these seven configuration elements is explained in a separate section:

This page explains how ObjectDB configuration works in general.

The Configuration Path

By default, the configuration file is loaded from $objectdb/objectdb.conf where $objectdb represents the ObjectDB home directory.

ObjectDB Home ($objectdb)

The value of $objectdb (the ObjectDB home directory) is derived from the location of the objectdb.jar file. It is defined as the path to the directory in which objectdb.jar is located, with one exception - if the name of that directory is bin, lib or build the parent directory is considered to be the ObjectDB home directory ($objectdb).

As a result, $objectdb is also the installation directory of ObjectDB since objectdb.jar is located in the bin directory under the installation directory. Notice, however, that moving objectdb.jar to another location changes the value of $objectdb. For example, in a web application, in which objectdb.jar is located in WEB-INF/lib, the ObjectDB home directory ($objectdb) is WEB-INF.

You can also define $objectdb explicitly by setting the "objectdb.home" system property:

  System.setProperty("objectdb.home", "/odb"); // new $objectdb

As with any other system property it can also be set as an argument to the JVM:

> java "-Dobjectdb.home=/odb" ...

The Configuration File

As noted above, by default the configuration file is loaded from $objectdb/objectdb.conf.

You can specify an alternative path by setting the "objectdb.conf" system property:

  System.setProperty("objectdb.conf", "/my/objectdb.conf");

It can also be set as an argument to the JVM:

> java "-Dobjectdb.conf=/my/objectdb.conf" ...

If a configuration file is not found default values are used.

General Configuration Considerations

The following rules apply to all the relevant configuration elements and attributes:

  • $objectdb, representing the ObjectDB home directory, and $temp, representing the system default temporary path, can be used in any path attribute value in the configuration file.
  • The mb and kb suffixes, representing megabytes and kilobytes (respectively), can be used in any size value attribute in the configuration file.
  • Appropriate file system permissions have to be set for all the paths that are specified in the configuration file (for the process that runs ObjectDB).