You are here: Configuration > Common Configuration > Disable Weak References

Disable Weak References

By default db4o uses weak references cache to all loaded objects. This ensures that the objects can be garbage collected. However it does impose a small overhead. You can disable weak reference if you like. Then db4o uses regular references. When disabled you need to remove objects explicit from the cache.

IEmbeddedConfiguration configuration = Db4oEmbedded.NewConfiguration();
configuration.Common.WeakReferences = false;
CommonConfigurationExamples.cs: Disable weak references
Dim configuration As IEmbeddedConfiguration = Db4oEmbedded.NewConfiguration()
configuration.Common.WeakReferences = False
CommonConfigurationExamples.vb: Disable weak references