title: How can a client query a db4o server?
body: <p>I've set up a db4o server and client. My client calls are not working.</p>
  
  <p>What's puzzling to me is that the db4o examples show how the client can close the server, but not how to get and save data. See: <a href="http://community.versant.com/Documentation/Reference/db4o-7.12/java/reference/Content/client-server/networked/simple_db4o_server.htm" rel="nofollow">http://community.versant.com/Documentation/Reference/db4o-7.12/java/reference/Content/client-server/networked/simple_db4o_server.htm</a></p>
  
  <p>If I start the db4o server, and run netstat, I can see that the port is open. And on the client, I can do things like this:</p>
  
  <p>Debug.WriteLine(db.Ext().IsClosed().ToString());</p>
  
  <p>And that returns False, which is good.</p>
  
  <p>But when I try to get or save data, it doesn't work. When saving data, it appears to work, but I don't see the data in the DB. When trying to retrieve the object, I get this error:</p>
  
  <p>Db4objects.Db4o.Ext.Db4oException: Exception of type 'Db4objects.Db4o.Ext.Db4oException' was thrown. ---> System.ArgumentException: Field '_delegateType' defined on type 'Db4objects.Db4o.Internal.Query.DelegateEnvelope' is not a field on the target object which is of type 'Db4objects.Db4o.Reflect.Generic.GenericObject'.</p>
  
  <p>Here are the client calls to save, then get:</p>
  
  <pre><code>Server server = new Server() { Name = "AppServerFoo" };
  IObjectContainer db = GetDatabase();
  db.Store(server);
  db.Close();
  </code></pre>
  
  <p>Here's the only line in the GetDatabase() method:</p>
  
  <pre><code>return Db4oClientServer.OpenClient(Db4oClientServer.NewClientConfiguration(), "DellXps", 8484, "user", "password");
  </code></pre>
  
  <p>And here's the call to get from the DB:</p>
  
  <pre><code>IObjectContainer db = GetDatabase();
  Server testServer = db.Query&lt;Server&gt;(server =&gt; server.Name == "AppServerFoo").FirstOrDefault();
  db.Close();
  </code></pre>
  
  <p>What am I missing?</p>