MarshalByRef objects from .NET Remoting can not be stored by db4o.
MarshalByRef objects are not really objects. They are proxy objects to instances, which live on another machine. There are 2 cases to distinguish:
1. Use marshal by value technology for the persistent object. In this case the object implements ISerializable interface and can be stored by db4o without any problems. The object is created on the client and is passed to the server using MarshalByRef proxy.
2. If using MarshalByRef object is mandatory for you, use the following configuration:
configuration.Common() .ObjectClass("System.Runtime.Remoting.ServerIdentity, mscorlib") .Translate(new TTransient()); configuration.Common() .ObjectClass("System.Threading.TimerCallback,mscorlib") .Translate(new TTransient());
The TTransient translator will prevent instances of ServerIdentity and TimerCallback from being stored within a db4o database. These classes are protected internal classes within the .NET Framework. When retrieving your MarshalByRef objects from db4o, you will need to re-marshal them.
Note: in many cases using db4o client-server version can be a better option for a remote persistence.