IObjectClass.

PersistStaticFieldValues() Method

Summary

turns on storing static field values for this class.
Assembly
Db4objects.Db4o-2010.dll
Namespace
Db4objects.Db4o.Config
Containing Type
IObjectClass

Syntax

void PersistStaticFieldValues()

Remarks

turns on storing static field values for this class.

By default, static field values of classes are not stored to the database file. By turning the setting on for a specific class with this switch, all non-simple-typed static field values of this class are stored the first time an object of the class is stored, and restored, every time a database file is opened afterwards, after class meta information is loaded for this class (which can happen by querying for a class or by loading an instance of a class).

To update a static field value, once it is stored, you have to the following in this order:
(1) open the database file you are working agains
(2) make sure the class metadata is loaded
objectContainer.Query().Constrain(typeof(Foo)); 

(3) change the static member
(4) store the static member explicitely
objectContainer.Store(Foo.staticMember); 


The setting will be ignored for simple types.

Use this setting for constant static object members.

This option will slow down the process of opening database files and the stored objects will occupy space in the database file.

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

This setting can NOT be applied to an open object container.

Return Value

Type Description
void