Configuring Repositories |
The repositories of a CDO Server are configured in the cdo-server.xml file. Here's an example:
cdo‑server.xml | ||||
<?xml version='1.0' encoding='UTF-8'?>
|
||||
The following sections describe the various elements and properties.
Table of Contents
Defines an IRepository
instance.
The name
attribute uniquely identifies a repository in the scope of a repository configurator.
The repository
element can contain several property elements (see below) and must contain exactly one store element.
Specifies a constant UUID for the repository. If omitted the repository will be created with a random UUID. The format of an override UUID is not further specified but should respect the file naming conventions of the used operating system.
Overriding the default random UUID can be useful if you have scripts that operate on the file system folder that is created on the server for each repository and named after the repository UUID.
Specifies whether the repository will support audit views or not. Please note that a repository can only support audit views if its store supports audit views, as well:
Store Type | Allowed Values | Default Value |
MEMStore | true / false | true |
DBStore | true / false | true, if the used mapping strategy supports audits |
HibernateStore | false | false |
ObjectivityStore | true / false | false |
DB4OStore | true / false | false |
MongoDBStore | true | true |
The shipped DBStore does support audit views. Note also that it will not delete or update rows for modified objects if audits are supported. All revised state of the repository will be kept in the DB which can result in databases growing very large!
Specifies whether the repository will support the creation and usage of branches below the always existing main branch or not. Please note that a repository can only support branches if its store supports branches, as well:
Store Type | Allowed Values | Default Value |
MEMStore | true / false | true |
DBStore | true / false | true, if the used mapping strategy supports branches |
HibernateStore | false | false |
ObjectivityStore | true / false | false |
DB4OStore | true / false | false |
MongoDBStore | true | true |
Also note that branching support always requires auditing support, too.
Specifies whether the repository will support the storage of instances of the Ecore (meta meta) model or not.
With the advent of the legacy mode in CDO 3.0 you can store instances of any model in CDO repositories. Whether these models have been generated for CDO or not only influences their characteristics (scalability, performance, etc.). As a consequence you can also store instances of the Ecore (meta meta) model in CDO Repositories. Since Ecore is always registered in all package registries the legacy mode would lead to the creation of mapped tables in many types of stores, even if you never planned to store instances of Ecore.
Valid values: false
(default) or true
.
Specifies whether the repository will serialize commit operations by utilizing a lock or not.
Some stores, such as the LissomeStore, require commit operations to be serialized.
Valid values: false
(default) or true
.
Specifies whether the repository will detect and reject commits that would leave stale references in the object graph.
Valid values: false
(default) or true
.
Specifies whether the repository will cancel a scheduled query job if it is already running.
Some underlying stores (e.g. DBStore with a Derby database) might not be able to deal with this cleanly.
For such stores, this parameter can be set to false
.
Valid values: false
(default) or true
.
Specifies whether the repository will expect clients to generate IDs for new objects or whether it will ask the backend store to generate them.
Valid values: STORE
(default) or CLIENT
.
Example: <securityManager type="default" description="/security:annotation:home(/home)"/>
See also: http://wiki.eclipse.org/CDO/Security_Manager
Example: <authenticator type="file" description="_database/repo1.users"/>
See also: http://bugs.eclipse.org/302775
Example: <initialPackage nsURI="http://www.eclipse.org/emf/CDO/examples/company/1.0.0"/>
See also: http://bugs.eclipse.org/345431
Defines an IStore
instance.
The type
attribute corresponds to the type of a store factory that is contributed via the
org.eclipse.emf.cdo.server.storeFactory
extension point.
The remaining attributes depend on the specified type
attribute value.
The following values are possible with the shipped distribution (subject to user-supplied extension):
Specifies, if the store is a DBStore, at what interval the store will issue an SQL statement to keep the connection to the database alive.
Specifies, if the store is a DBStore, the maximum number of store accessors (JDBC connections) to keep in the reader pool.
The default value is 15.
Specifies, if the store is a DBStore, the maximum number of store accessors (JDBC connections) to keep in the writer pool.
The default value is 15.
This element is recognized by DBStores and defines the overall mapping strategy
of the built-in O/R mapper.
The type
attribute corresponds to the type of a mapping strategy factory that is contributed via the
org.eclipse.emf.cdo.server.db.mappingStrategies
extension point.
The following values are possible with the shipped distribution (subject to user-supplied extension):
Specifies how the built-in O/R mapper will handle to-many references (collections). The following values are recognized:
Enables you to override the default value of the chosen DB adapter for the maximum length of table names.
Enables you to override the default value of the chosen DB adapter for the maximum length of column names.
Specifies a common fixed prefix for all table names generated by this mapping strategy.
Specifies whether generated package or class table names are qualified or not.
Specifies whether generated names are always suffixed with an internal ID or only in cases where the generated name absolutely needs mangling.
Specifies whether you want IDBField
construction stacktrace on schema update to have the origin of the nullable index field.
Specifies the size of the object type in-memory cache. Possible configuration values are:
Specifies the name of a ColumnTypeModifier
.
Specifies on what types of structural features additional indexes are to be created. The value is either empty or a | (pipe) separated list of the following tokens:
Defines the IDBAdapter
instance of the store that interprets the SQL dialect of the used database.
The type
attribute corresponds to the name of a DB adapter factory that is contributed via the
org.eclipse.net4j.db.dbAdapters
extension point. No additional attributes are recognized.
The DB adapter must match the database specified in the dataSource element.
Defines the DataSource
instance of the store.
The class
attribute corresponds to the fully qualified name of the data source class.
Please refer to your DB manual for details about the supported data sources and their attributes.