private void BeginInitializeInfo(AsyncCallback callback, IPersistenceEngineAsync engine) { Entity e = new Entity(SyncUtils.INFO); e.SetValue(SyncUtils.TRANSACTION, 0); e.SetValue(SyncUtils.CLIENTID, String.Empty); Transaction t = new Transaction(engine.FactoryAsync.Model); t.Serialize(e); t.BeginCommit(callback, engine, false, t); }
public override void BeginProcessCommands(Transaction tx, AsyncCallback callback, object asyncState) { WaitForAll waitForAllCallback = new WaitForAll(callback, asyncState); base.BeginProcessCommands(tx, waitForAllCallback.Callback("engine"), asyncState); Transaction t; SyncCommandProcessor syncCommandProcessor; GenerateTransactionId(metadataEngine); t = new Transaction(metadataEngine.Factory.Model); syncCommandProcessor = new SyncCommandProcessor(this, t, lastTransactionId); foreach (Command c in tx.PendingCommands) { // Ignores commands in metadata if (c.IgnoreMetadata || ignoreClientMetadata) continue; syncCommandProcessor.Visit(c); } t.BeginCommit(waitForAllCallback.Callback("metadata"), metadataEngine, false, t); if (secondaryMetadataEngine != null) { GenerateTransactionId(secondaryMetadataEngine); t = new Transaction(secondaryMetadataEngine.Factory.Model); syncCommandProcessor = new SyncCommandProcessor(this, t, lastTransactionId); foreach (Command c in tx.PendingCommands) { syncCommandProcessor.Visit(c); } t.BeginCommit(waitForAllCallback.Callback("metadata2"), secondaryMetadataEngine, false, t); } }