Server Configuration

The <server> configuration element specifies settings for running an ObjectDB Server.

The server is also affected by other elements in the configuration file, such as the <users> and <ssl> elements. The default configuration file contains the following <server> element:

<server>
  <connection port="6136" max="0" />
  <data path="$objectdb/db-files" />
  <!--
  <replication url="objectdb://localhost/my.odb;user=admin;password=admin" />
  -->
</server>

Each of the following sections describes one subelement:

The <connection> elementThe <data> elementThe <replication> elements

The <connection> element

  <connection port="6136" max="0" />

The <connection> element specifies how clients can connect to the server:

  • The port attribute specifies the TCP port on which the server listens for new connections. The default port is 6136. If you use a different port, clients must also specify it in the connection URL string, as explained in the JPA Overview section.
  • The max attribute specifies the maximum number of simultaneous connections that the server accepts. A connection request that exceeds this limit causes an exception on the client. A value of 0 indicates no limit on the number of connections.

The <data> element

  <data path="$objectdb/db-files" />

The <data> element has one attribute, path, which specifies the location of ObjectDB databases that the server manages. The $objectdb prefix, if specified, represents the ObjectDB home directory.

The data path of an ObjectDB server is similar to the document root directory of a web server. Every database file in the data directory and its subdirectories can be accessed by the server. The server process requires appropriate file system permissions on the data directory, its subdirectories, and database files to operate correctly.

When connecting to the server, the path specified in the connection URL is resolved relative to the data path. For example, objectdb://localhost/my/db.odb refers to a database file named db.odb in a subdirectory named my within the data directory.

The <replication> elements

<replication url="objectdb://localhost/my.odb;user=admin;password=admin" />

Optional <replication> elements define the replication of ObjectDB databases in a master-slave cluster. Each slave server requires a <replication> element to define its replicated slave database. For more information about replication, see the Database Replication and Clustering page.