Beispiel #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);
            }
        }
Beispiel #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);
            }
        }