Example #1
0
        protected void RemoveTransactionReferences(MemoryDeviceTransaction ATransaction, Schema.TableVar ATableVar)
        {
            Operation LOperation;

            for (int LOperationIndex = ATransaction.Operations.Count - 1; LOperationIndex >= 0; LOperationIndex--)
            {
                LOperation = ATransaction.Operations[LOperationIndex];
                if (LOperation.TableVar.Equals(ATableVar))
                {
                    ATransaction.Operations.RemoveAt(LOperationIndex);
                    LOperation.Dispose();
                }
            }

            foreach (MemoryDeviceTransaction LTransaction in ATransaction.Transactions)
            {
                RemoveTransactionReferences(LTransaction, ATableVar);
            }
        }
Example #2
0
        protected void InternalRollbackTransaction(MemoryDeviceTransaction ATransaction)
        {
            Operation       LOperation;
            InsertOperation LInsertOperation;
            UpdateOperation LUpdateOperation;
            DeleteOperation LDeleteOperation;

            for (int LIndex = ATransaction.Operations.Count - 1; LIndex >= 0; LIndex--)
            {
                LOperation = ATransaction.Operations[LIndex];

                LInsertOperation = LOperation as InsertOperation;
                if (LInsertOperation != null)
                {
                    InsertRow(LInsertOperation.TableVar, LInsertOperation.Row);
                }

                LUpdateOperation = LOperation as UpdateOperation;
                if (LUpdateOperation != null)
                {
                    UpdateRow(LUpdateOperation.TableVar, LUpdateOperation.OldRow, LUpdateOperation.NewRow);
                }

                LDeleteOperation = LOperation as DeleteOperation;
                if (LDeleteOperation != null)
                {
                    DeleteRow(LDeleteOperation.TableVar, LDeleteOperation.Row);
                }

                ATransaction.Operations.RemoveAt(LIndex);
                LOperation.Dispose();
            }

            foreach (MemoryDeviceTransaction LTransaction in ATransaction.Transactions)
            {
                InternalRollbackTransaction(LTransaction);
            }
        }
Example #3
0
        protected override void Dispose(bool ADisposing)
        {
            if (FOperations != null)
            {
                foreach (Operation LOperation in FOperations)
                {
                    LOperation.Dispose();
                }
                FOperations.Clear();
                FOperations = null;
            }

            if (FTransactions != null)
            {
                foreach (MemoryDeviceTransaction LTransaction in FTransactions)
                {
                    LTransaction.Dispose();
                }
                FTransactions.Clear();
                FTransactions = null;
            }

            base.Dispose(ADisposing);
        }