13. Configurationdb4o provides a wide range of configuration methods to request special behaviour. For a complete list of all available methods see the API documentation for the Db4objects.Db4o.Config namespace. A more complete description of Configuration usage and scope can also be obtained from the Reference documentation. Some hints around using configuration calls: 13.1. ScopeConfiguration calls can be issued to a global configuration context with
and to an open IObjectContainer/IObjectServer with
A separate configuration instance can be obtained with
or cloned from the global configuration with
Configuration can be submitted when an IObjectContainer/IObjectServer is opened:
Otherwise the global configuration context will be cloned and copied into the newly opened IObjectContainer/IObjectServer. Subsequent calls against the global context with Db4oFactory.Configure() have no effect on open IObjectContainers/IObjectServers. 13.2. Calling MethodsMany configuration methods have to be called before an IObjectContainer/IObjectServer is opened and will be ignored if they are called against open IObjectContainers/IObjectServers. Some examples:
Configurations that influence the database file format will have to take place, before a database is created, before the first #OpenXXX() call. Some examples:
Configuration settings are not stored in db4o database files. Accordingly the same configuration has to be submitted every time an ObjectContainer/ObjectServer is opened. For using db4o in client/server mode it is recommended to use the same configuration on the server and on the client. To set this up nicely it makes sense to create one application class with one method that creates an appropriate configuration and to deploy this class both to the server and to all clients. |