Exemplo n.º 1
0
        // creates new designer with arguments (safe)
        internal static NameChainer GetNewDesigner(
            string name,
            bool isEmbeddedTransaction,
            bool isEmbeddedTryCatch, Designer.IsolationLevel isolationLevel = IsolationLevel.Default)
        {
            var root = new InternalRoot(isEmbeddedTransaction);

            root.IsEmbeddedTryCatch = isEmbeddedTryCatch;
            root.Name = name;
            return(new NameChainer(root, isolationLevel));
        }
Exemplo n.º 2
0
 internal SetIsolationLevelChainer(Chainer prev, Designer.IsolationLevel isolationLevel)
     : base(prev)
 {
     Build = (buildContext, buildArgs) =>
     {
         string isolation = isolationLevel.ToSql();
         return(Text.GenerateSql(50)
                .NewLine(Text.SetTransactionIsolationLevel).S()
                .Append(isolation)
                .Terminate()
                .ToString());
     };
 }
Exemplo n.º 3
0
        internal NameChainer(Chainer prev,
                             Designer.IsolationLevel embeddedTransactionIsolationLevel = Designer.IsolationLevel.Default)
            : base(prev)
        {
            // check root reuse
            var root = prev.GetRoot();

            if (root.IsUsed)
            {
                if (root.Node != null && root.Node.IsUsed)
                {
                    throw new QueryTalkException("NameChainer.ctor",
                                                 QueryTalkExceptionType.RootReuseDisallowed, String.Format("root = {0}", root.Name));
                }

                root.ClearForReuse();
            }

            root.SetAsUsed();
            root.EmbeddedTransactionIsolationLevel = embeddedTransactionIsolationLevel;
        }
Exemplo n.º 4
0
 /// <summary>
 /// Controls the locking and row versioning behavior of Transact-SQL statements issued by a connection to SQL Server.
 /// </summary>
 /// <param name="prev">A predecessor object.</param>
 /// <param name="isolationLevel">A type of the isolation level.</param>
 public static SetIsolationLevelChainer SetIsolationLevel(this IAny prev, Designer.IsolationLevel isolationLevel)
 {
     return(new SetIsolationLevelChainer((Chainer)prev, isolationLevel));
 }