By default db4o by passes the constructor to instantiate the objects. Therefore it uses the reflection capabilities of the current platform. On some embedded platform this is not possible because of security and platform constrains. On other platforms bypassing the constructor is significantly slower than calling it. Therefore you change the behavior so that db4o calls the constructor. Note that when you enable this setting, you classes need a constructor which can be called with default-arguments without throwing an exception.
IEmbeddedConfiguration configuration = Db4oEmbedded.NewConfiguration(); configuration.Common.CallConstructors = true;
Dim configuration As IEmbeddedConfiguration = Db4oEmbedded.NewConfiguration() configuration.Common.CallConstructors = True
You can enable this setting only for certain classes. For example when the constructor needs to initialize transient fields.
IEmbeddedConfiguration configuration = Db4oEmbedded.NewConfiguration(); configuration.Common.ObjectClass(typeof (Person)).CallConstructor(true);
Dim configuration As IEmbeddedConfiguration = Db4oEmbedded.NewConfiguration() configuration.Common.ObjectClass(GetType(Person)).CallConstructor(True)