Ejemplo n.º 1
0
        public void Begin_Tran_With_Name_And_Distribution(string sql, string name, TransactionDescriptor descriptor, bool distributed)
        {
            // Exercise
            BeginTransactionStatement statement = ParserFactory.Execute <BeginTransactionStatement>(sql).First();

            // Verify outcome
            Assert.IsNotNull(statement);
            Assert.AreEqual(name, statement.Name);
            Assert.AreEqual(descriptor, statement.Descriptor);
            Assert.AreEqual(distributed, statement.Distributed);
        }
Ejemplo n.º 2
0
        protected override void VisitBeginTransaction(BeginTransactionStatement statement)
        {
            {
                State.Write(Symbols.BEGIN);
                State.Write(Symbols.TRANSACTION);
                VisitTransactionName(statement);

                if (statement.IsolationLevel != null)
                {
                    State.Write(Symbols.ISOLATION);
                    State.Write(Symbols.LEVEL);
                    switch (statement.IsolationLevel.Value)
                    {
                    case IsolationLevelType.Serializable:
                        State.Write(Symbols.SERIALIZABLE);
                        break;

                    case IsolationLevelType.RepeatableRead:
                        State.Write(Symbols.REPEATABLE);
                        State.Write(Symbols.READ);
                        break;

                    case IsolationLevelType.ReadCommited:
                        State.Write(Symbols.READ);
                        State.Write(Symbols.COMMITED);
                        break;

                    case IsolationLevelType.ReadUnCommited:
                        State.Write(Symbols.READ);
                        State.Write(Symbols.UNCOMMITED);
                        break;
                    }
                }
                if (statement.AccessType != null)
                {
                    switch (statement.AccessType.Value)
                    {
                    case TransactionAccessType.ReadOnly:
                        State.Write(Symbols.READ);
                        State.Write(Symbols.ONLY);
                        break;

                    case TransactionAccessType.ReadWrite:
                        State.Write(Symbols.READ);
                        State.Write(Symbols.WRITE);
                        break;
                    }
                }
            }
        }
Ejemplo n.º 3
0
        protected override void VisitBeginTransaction(BeginTransactionStatement statement)
        {
            State.Write(Symbols.BEGIN);
            if (statement.Type.HasValue)
            {
                switch (statement.Type.Value)
                {
                case TransactionType.Deferred:
                    State.Write(Symbols.DEFERRED);
                    break;

                case TransactionType.Immediate:
                    State.Write(Symbols.IMMIDIATE);
                    break;

                case TransactionType.Exclusive:
                    State.Write(Symbols.EXCLUSIVE);
                    break;
                }
            }
            State.Write(Symbols.TRANSACTION);
        }
Ejemplo n.º 4
0
 public override void Visit(BeginTransactionStatement node)
 {
     TransactionLists.Add(new TrackedTransaction {
         Begin = node
     });
 }
Ejemplo n.º 5
0
 public override void Visit(BeginTransactionStatement node) { this.action(node); }
Ejemplo n.º 6
0
 //TODO: Add transaction characteristic
 protected override void VisitBeginTransaction(BeginTransactionStatement statement)
 {
     State.Write(Symbols.START);
     State.Write(Symbols.TRANSACTION);
 }
 public override void ExplicitVisit(BeginTransactionStatement fragment)
 {
     _fragments.Add(fragment);
 }
Ejemplo n.º 8
0
 protected abstract void VisitBeginTransaction(BeginTransactionStatement statement);