public static void SetSecondCar(IObjectContainer db) { Pilot pilot = new Pilot("Michael Schumacher", 100); Car car = new Car("Ferrari"); car.Pilot = pilot; db.Store(car); }
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))); } }
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))); } }
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 Car(string model) { _model = model; _pilot = null; _history = null; }