server> configuration element specifies settings for running an ObjectDB Server.
The default configuration file contains the following
<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> element
<connection port="6136" max="0" />
<connection> element specifies how clients can connect to the server:
portattribute specifies a TPC port on which the server is listening for new connections. Usually the default port
6136should be specified. If another port is specified it also has to be specified by clients in the url connection string when connecting to the database (as explained in the JPA Overview section in chapter 3).
maxattribute specifies the maximum number of simultaneous connections that are accepted by the server. A request for a connection that exceeds the maximum throws an exception on the client side. 0 indicates no maximum connections limit.
The <data> element
<data path="$objectdb/db-files" />
<data> element has one attribute,
path, which specifies the location of ObjectDB databases that the server manages. The
$objectdb prefix, if specified (as demonstrated above), 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 in its subdirectories can be accessed by the server. Appropriate file system permissions have to be set on the data directory, its subdirectories and database files, to enable operations of the server process.
When connecting to the server the path that is specified in the url connection is resolved relative to the data path. For example,
"objectdb://localhost/my/db.odb" refers to a database file
db.odb in a subdirectory
'my' of the data directory.
The <replication> elements
<replication url="objectdb://localhost/my.odb;user=admin;password=admin" />
<replication> elements are optional elements that define replication of ObjectDB databases in a master-slave cluster. A
<replication> element is only required on the slave server to define the replicated slave database. More details on replication are provided on the Database Replication and Clustering page.