Esempio n. 1
0
        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);
            }
        }
Esempio n. 2
0
        public override void BeginInitializeRepository(AsyncCallback callback, object asyncState)
        {
            WaitForAll waitForAllCallback = new WaitForAll(callback, asyncState);
            base.BeginInitializeRepository(waitForAllCallback.Callback("engine"), asyncState);
            metadataEngine.BeginInitializeRepository(waitForAllCallback.Callback("metadata"), asyncState);
            BeginInitializeInfo(waitForAllCallback.Callback("metadata-transaction"), metadataEngine);

            if (secondaryMetadataEngine != null)
            {
                secondaryMetadataEngine.BeginInitializeRepository(waitForAllCallback.Callback("metadata2"), asyncState);
                BeginInitializeInfo(waitForAllCallback.Callback("metadata2-transaction"), secondaryMetadataEngine);
            }

        }