示例#1
0
 public static void SetSecondCar(IObjectContainer db)
 {
     Pilot pilot = new Pilot("Michael Schumacher", 100);
     Car car = new Car("Ferrari");
     car.Pilot = pilot;
     db.Store(car);
 }
示例#2
0
 public static void SetFirstCar(IObjectContainer db)
 {
     Pilot pilot = new Pilot("Rubens Barrichello", 99);
     Car car = new Car("BMW");
     car.Pilot = pilot;
     db.Store(car);
 }
 public static void DemonstrateLocalReadCommitted(IObjectServer server)
 {
     using (IObjectContainer client1 = server.OpenClient(),
            client2 = server.OpenClient())
     {
         Pilot      pilot  = new Pilot("David Coulthard", 98);
         IObjectSet result = client1.QueryByExample(new Car("BMW"));
         Car        car    = (Car)result.Next();
         car.Pilot = pilot;
         client1.Store(car);
         ListResult(client1.QueryByExample(new Car(null)));
         ListResult(client2.QueryByExample(new Car(null)));
         client1.Commit();
         ListResult(client1.QueryByExample(typeof(Car)));
         ListRefreshedResult(client2, client2.QueryByExample(typeof(Car)), 2);
     }
 }
 public static void DemonstrateRemoteReadCommitted(int port, string user, string password)
 {
     using (IObjectContainer client1 = Db4oClientServer.OpenClient("localhost", port, user, password),
            client2 = Db4oClientServer.OpenClient("localhost", port, user, password))
     {
         Pilot      pilot  = new Pilot("Jenson Button", 97);
         IObjectSet result = client1.QueryByExample(new Car(null));
         Car        car    = (Car)result.Next();
         car.Pilot = pilot;
         client1.Store(car);
         ListResult(client1.QueryByExample(new Car(null)));
         ListResult(client2.QueryByExample(new Car(null)));
         client1.Commit();
         ListResult(client1.QueryByExample(new Car(null)));
         ListResult(client2.QueryByExample(new Car(null)));
     }
 }
示例#5
0
 public static void DemonstrateRemoteReadCommitted(int port, string user, string password)
 {
     using(IObjectContainer client1 = Db4oClientServer.OpenClient("localhost", port, user, password),
             client2 = Db4oClientServer.OpenClient("localhost", port, user, password))
     {
         Pilot pilot = new Pilot("Jenson Button", 97);
         IObjectSet result = client1.QueryByExample(new Car(null));
         Car car = (Car)result.Next();
         car.Pilot = pilot;
         client1.Store(car);
         ListResult(client1.QueryByExample(new Car(null)));
         ListResult(client2.QueryByExample(new Car(null)));
         client1.Commit();
         ListResult(client1.QueryByExample(new Car(null)));
         ListResult(client2.QueryByExample(new Car(null)));
     }
 }
示例#6
0
 public static void DemonstrateLocalReadCommitted(IObjectServer server)
 {
     using(IObjectContainer client1 =server.OpenClient(),
         client2 =server.OpenClient())
     {
         Pilot pilot = new Pilot("David Coulthard", 98);
         IObjectSet result = client1.QueryByExample(new Car("BMW"));
         Car car = (Car)result.Next();
         car.Pilot = pilot;
         client1.Store(car);
         ListResult(client1.QueryByExample(new Car(null)));
         ListResult(client2.QueryByExample(new Car(null)));
         client1.Commit();
         ListResult(client1.QueryByExample(typeof(Car)));			
         ListRefreshedResult(client2, client2.QueryByExample(typeof(Car)), 2);
     }
 }
示例#7
0
文件: Car.cs 项目: pondyond/db4o
 public Car(string model)
 {
     _model   = model;
     _pilot   = null;
     _history = null;
 }
示例#8
0
文件: Car.cs 项目: Galigator/db4o
 public Car(string model)
 {
     _model = model;
     _pilot = null;
     _history = null;
 }