コード例 #1
0
ファイル: DbInstance.cs プロジェクト: vb2ae/ClientNoSqlDB
        internal ITransactionScope WriteScope()
        {
            var result = Current;

            if (result is BulkReadScope)
            {
                throw new InvalidOperationException("Nested write transaction inside read only one");
            }

            if (result == null)
            {
                result = new BulkWriteScope();
            }

            result.AddRef();

            return(Current = result);
        }
コード例 #2
0
        internal ITransactionScope WriteScope()
        {
#if NLOG
            if (Log.IsTraceEnabled)
            {
                Log.Trace("Begin write transaction");
            }
#endif
            var result = Current;

            if (result is BulkReadScope)
            {
                throw new InvalidOperationException("Nested write transaction inside read only one");
            }

            if (result == null)
            {
                result = new BulkWriteScope();
            }

            result.AddRef();

            return(Current = result);
        }