Chapter 6 - Configuration

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

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

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

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 the path to the directory that contains objectdb.jar, with one exception: if that directory is named bin, lib, or build, its parent directory is the ObjectDB home directory ($objectdb).

As a result, $objectdb is typically the ObjectDB installation directory because objectdb.jar is in the bin subdirectory. However, moving objectdb.jar changes the value of $objectdb. For example, in a web application where objectdb.jar is 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

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 configuration elements and attributes:

  • You can use the variables $objectdb (the ObjectDB home directory) and $temp (the system's default temporary path) in any path attribute value.
  • You can use the mb (megabytes) and kb (kilobytes) suffixes in any size value attribute.
  • The process that runs ObjectDB must have appropriate file system permissions for all paths specified in the configuration file.