IConfiguration Interface

Summary

configuration interface.
Assembly
Db4objects.Db4o-2010.dll
Namespace
Db4objects.Db4o.Config
Implementing Types
graph BT Type["IConfiguration"] class Type type-node Implementing0["Config4Impl"]-.->Type click Implementing0 "/db4o-gpl-doc/output/api/Db4objects.Db4o.Internal/Config4Impl"

Syntax

public interface IConfiguration

Remarks

configuration interface.

This interface contains methods to configure db4o.

The global Configuration context is available with Db4objects.Db4o.Db4oFactory.Configure . When an ObjectContainer or ObjectServer is opened, the global Configuration context is cloned and copied into the ObjectContainer/ObjectServer. That means every ObjectContainer/ObjectServer gets it's own copy of configuration settings.

Most configuration settings should be set before opening an ObjectContainer/ObjectServer.

Some configuration settings can be modified on an open ObjectContainer/ObjectServer. The local Configuration context is available with Db4objects.Db4o.Ext.IExtObjectContainer.Configure and Db4objects.Db4o.Ext.IExtObjectServer.Configure .

Properties

Name Value Summary
Storage IStorage
allows to configure db4o to use a customized byte IO storage mechanism. returns the configured Db4objects.Db4o.IO.IStorage

Methods

Name Value Summary
ActivationDepth() int
gets the configured activation depth.
ActivationDepth(int) void
sets the activation depth to the specified value. gets the configured activation depth.
Add(IConfigurationItem) void
adds ConfigurationItems to be applied when an ObjectContainer or ObjectServer is opened.
AddAlias(IAlias) void
adds a new Alias for a class, namespace or package.
AllowVersionUpdates(bool) void
turns automatic database file format version updates on.
AutomaticShutDown(bool) void
turns automatic shutdown of the engine on and off.
BlockSize(int) void
sets the storage data blocksize for new ObjectContainers.
BTreeCacheHeight(int) void
configures caching of BTree nodes.
BTreeNodeSize(int) void
configures the size of BTree nodes in indexes.
Cache() ICacheConfiguration
returns the Cache configuration interface.
Callbacks(bool) void
turns callback methods on and off.
CallConstructors(bool) void
advises db4o to try instantiating objects with/without calling constructors.
ClassActivationDepthConfigurable(bool) void
turns Db4objects.Db4o.Config.IObjectClass.MaximumActivationDepth(System.Int32) on and off.

This feature is turned on by default.

In client/server environment this setting should be used on both client and server.

ClientServer() IClientServerConfiguration
returns client/server configuration interface.
DatabaseGrowthSize(int) void
configures the size database files should grow in bytes, when no free slot is found within.
DetectSchemaChanges(bool) void
tuning feature: configures whether db4o checks all persistent classes upon system startup, for added or removed fields.
Diagnostic() IDiagnosticConfiguration
returns the configuration interface for diagnostics.
DisableCommitRecovery() void
turns commit recovery off.
Encrypt(bool) void
configures the use of encryption.
ExceptionsOnNotStorable(bool) void
configures whether Exceptions are to be thrown, if objects can not be stored.
Freespace() IFreespaceConfiguration
returns the freespace configuration interface.
GenerateCommitTimestamps(bool) void
Configures db4o to generate commit timestamps for all stored objects.

All the objects commited within a transaction will share the same commit timestamp.
GenerateUUIDs(ConfigScope) void
configures db4o to generate UUIDs for stored objects.
GenerateVersionNumbers(ConfigScope) void
configures db4o to generate version numbers for stored objects.
InternStrings() bool
returns true if strings will be interned.
InternStrings(bool) void
configures db4o to call #intern() on strings upon retrieval.
LockDatabaseFile(bool) void
can be used to turn the database file locking thread off.
MarkTransient(string) void
allows to mark fields as transient with custom attributes.
MaxStackDepth() int
MaxStackDepth(int) void
MessageLevel(int) void
sets the detail level of db4o messages.
ObjectClass(Object) IObjectClass
returns an Db4objects.Db4o.Config.IObjectClass object to configure the specified class.

The clazz parameter can be any of the following:
- a fully qualified classname as a String.
- a Class object.
- any other object to be used as a template.

OptimizeNativeQueries() bool
indicates whether Native Queries will be optimized dynamically.
OptimizeNativeQueries(bool) void
If set to true, db4o will try to optimize native queries dynamically at query execution time, otherwise it will run native queries in unoptimized mode as SODA evaluations.
Password(string) void
protects the database file with a password.
Queries() IQueryConfiguration
returns the Query configuration interface.
ReadOnly(bool) void
turns readOnly mode on and off.
RecoveryMode(bool) void
turns recovery mode on and off.

Recovery mode can be used to try to retrieve as much as possible out of an already corrupted database.
ReflectWith(IReflector) void
configures the use of a specially designed reflection implementation.
RegisterTypeHandler(ITypeHandlerPredicate, ITypeHandler4) void
allows registering special TypeHandlers for customized marshalling and customized comparisons.
RemoveAlias(IAlias) void
Removes an alias previously added with Db4objects.Db4o.Config.IConfiguration.AddAlias(Db4objects.Db4o.Config.IAlias) .
ReserveStorageSpace(long) void
tuning feature only: reserves a number of bytes in database files.
SetBlobPath(string) void
configures the path to be used to store and read Blob data.
SetOut(TextWriter) void
Assigns a System.IO.TextWriter where db4o is to print its event messages.

Messages are useful for debugging purposes and for learning to understand, how db4o works. The message level can be raised with Db4objects.Db4o.Config.IConfiguration.MessageLevel(System.Int32) to produce more detailed messages.

Use
setOut(System.out)
to print messages to the console.

In client-server environment this setting should be used on the same side where Db4objects.Db4o.Config.IConfiguration.MessageLevel(System.Int32) is used.

StringEncoding(IStringEncoding) void
configures the string encoding to be used.
TestConstructors(bool) void
tuning feature: configures whether db4o should try to instantiate one instance of each persistent class on system startup.
UpdateDepth(int) void
specifies the global updateDepth.
WeakReferenceCollectionInterval(int) void
configures the timer for WeakReference collection.
WeakReferences(bool) void
turns weak reference management on or off.