db4o's is an embedded database which usually runs in process. Nevertheless db4o also supports a client server setup. There's no ready to use db4o server, instead you embedded the db4o server in a regular application. This gives you full how you want to run the db4o server.
In order to use the db4o client server mode you need to include the Db4objects.Db4o.CS.dll-assembly in your project. See "Dependency Overview"
You start the server by creating a object server instance with the client server factory. Pass the database file path and the port to the factory. After that you need to specify a user-name and password which clients can use to login to this server. You can add multiple users by calling the grant access method multiple times.
using (IObjectServer server = Db4oClientServer.OpenServer("database.db4o", 8080)) { server.GrantAccess("user", "password"); // Let the server run. LetServerRun(); }
Using server As IObjectServer = Db4oClientServer.OpenServer("database.db4o", 8080) server.GrantAccess("user", "password") ' Let the server run. LetServerRun() End Using
After the server is up an running you can connect to it. Pass the URL, port, user name and password to the client server factory. This will return a client object container. After that the container is ready to use.
using (IObjectContainer container = Db4oClientServer.OpenClient("localhost", 8080, "user", "password")) { // Your operations }
' Your operations Using container As IObjectContainer = Db4oClientServer.OpenClient("localhost", 8080, "user", "password") End Using