private Kontroll() { Db4objects.Db4o.Config.IEmbeddedConfiguration minConfig = Db4oEmbedded.NewConfiguration(); minConfig.Common.ActivationDepth = 5; minConfig.Common.UpdateDepth = 2; objBase = Db4oEmbedded.OpenFile(minConfig, odbName); }
private void DoBiDirectionalReplication() { Db4objects.Db4o.IObjectContainer handheld = OpenDb(ConfigureDb4oForReplication(), "handheld.yap"); StoreSomePilots(handheld); Db4objects.Db4o.IObjectContainer desktop = OpenDb(ConfigureDb4oForReplication(), "desktop.yap"); StoreSomeMorePilots(desktop); DisplayContents("Bi-Directional", "Before", handheld, desktop); Db4objects.Drs.IReplicationSession replication = Db4objects.Drs.Replication.Begin(ProviderFor(handheld), ProviderFor(desktop)); Db4objects.Db4o.IObjectSet changed = replication.ProviderA().ObjectsChangedSinceLastReplication (); while (changed.HasNext()) { replication.Replicate(changed.Next()); } changed = replication.ProviderB().ObjectsChangedSinceLastReplication(); while (changed.HasNext()) { replication.Replicate(changed.Next()); } replication.Commit(); DisplayContents(string.Empty, "After", handheld, desktop); CloseDb(handheld); CloseDb(desktop); }
private Kontroll() { Db4objects.Db4o.Config.IEmbeddedConfiguration minConfig = Db4oEmbedded.NewConfiguration(); minConfig.Common.ActivationDepth = 5; minConfig.Common.UpdateDepth = 2; objBase = Db4oEmbedded.OpenFile(minConfig, odbName); }
private void DisplayContentsOf(string heading, Db4objects.Db4o.IObjectContainer db ) { Sharpen.Runtime.Out.WriteLine(heading); Sharpen.Runtime.Out.WriteLine(); Db4objects.Db4o.IObjectSet result = db.QueryByExample(new Db4objects.Drs.Quickstart.Simple.Pilot()); ListResult(result); }
private void DisplayContents(string methodname, string pointintime, Db4objects.Db4o.IObjectContainer handheld, Db4objects.Db4o.IObjectContainer desktop) { if (methodname != string.Empty) { Sharpen.Runtime.Out.WriteLine(methodname + " Replication"); Sharpen.Runtime.Out.WriteLine(); } Sharpen.Runtime.Out.WriteLine(pointintime + " Replication"); Sharpen.Runtime.Out.WriteLine(); DisplayContentsOf("Contents of Handheld", handheld); DisplayContentsOf("Contents of Desktop", desktop); }
public virtual void DoSelectiveReplication() { Db4objects.Db4o.IObjectContainer handheld = OpenDb(ConfigureDb4oForReplication(), "handheld.yap"); StoreSomePilots(handheld); Db4objects.Db4o.IObjectContainer desktop = OpenDb(ConfigureDb4oForReplication(), "desktop.yap"); DisplayContents("Selective Replication", "Before", handheld, desktop); Db4objects.Drs.IReplicationSession replication = Db4objects.Drs.Replication.Begin(ProviderFor(handheld), ProviderFor(desktop)); Db4objects.Db4o.IObjectSet changed = replication.ProviderA().ObjectsChangedSinceLastReplication (); while (changed.HasNext()) { Db4objects.Drs.Quickstart.Simple.Pilot p = (Db4objects.Drs.Quickstart.Simple.Pilot )changed.Next(); if (p._name.StartsWith("S")) { replication.Replicate(p); } } replication.Commit(); DisplayContents(string.Empty, "After", handheld, desktop); CloseDb(handheld); CloseDb(desktop); }
private void Initialize() { if (objContainer == null) { objContainer = Db4oEmbedded.OpenFile("config.db4o"); } }
private void StoreSomePilots(Db4objects.Db4o.IObjectContainer db) { db.Store(new Db4objects.Drs.Quickstart.Simple.Pilot("Scott Felton", 52)); db.Store(new Db4objects.Drs.Quickstart.Simple.Pilot("Frank Green", 45)); }
private void CloseDb(Db4objects.Db4o.IObjectContainer db) { db.Close(); }
private void StoreSomeMorePilots(Db4objects.Db4o.IObjectContainer db) { db.Store(new Db4objects.Drs.Quickstart.Simple.Pilot("Peter van der Merwe", 37)); db.Store(new Db4objects.Drs.Quickstart.Simple.Pilot("Albert Kwan", 30)); }
public Db4oObjectSet(Db4objects.Db4o.IObjectContainer container) { Contract.Requires <ArgumentNullException>(container != null, "container"); _container = container; }