Пример #1
0
 /** @deprecated using deprecated api */
 public void test() throws Exception {
   int originalActivationDepth = ((Config4Impl) Db4o.configure()).activationDepth();
   Db4o.configure().activationDepth(0);
   ObjectServer server = Db4oClientServer.openServer(tempFile(), -1);
   try {
     server.grantAccess("db4o", "db4o");
     ObjectContainer oc =
         Db4oClientServer.openClient("localhost", server.ext().port(), "db4o", "db4o");
     oc.close();
   } finally {
     Db4o.configure().activationDepth(originalActivationDepth);
     server.close();
   }
 }
Пример #2
0
 private void start() {
   ObjectContainer oc =
       com.db4o.cs.Db4oClientServer.openClient(
           Db4oNetworking.HOST, _port, Db4oNetworking.USERNAME, Db4oNetworking.PASSWORD);
   oc.store(new Item(0));
   oc.commit();
   print("[0]");
   print(CLIENT_STARTED_OK);
   for (int i = 1; i < ITEM_COUNT; i++) {
     oc.store(new Item(i));
     oc.commit();
     print("[" + i + "]");
   }
   oc.close();
   print(CLIENT_COMPLETED_OK);
 }