示例#1
0
        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);
        }