Пример #1
0
        /// <summary>
        /// Transaction disposed notify
        /// </summary>
        /// <param name="transaction"></param>
        internal void OnTransactionDisposed(IDbTransaction transaction)
        {
            Expect.IsNotNull(transaction, nameof(transaction));
            Expect.That(transaction == _transaction,
                        () => ExceptionBuilder.InvalidOperation(FrameworkStrings.ErrorTransactionBelongToOther));

            _transaction = null;
        }
Пример #2
0
        /// <inheritdoc />
        public IDbTransaction BeginTransaction()
        {
            if (_transaction != null)
            {
                throw ExceptionBuilder.InvalidOperation(FrameworkStrings.ErrorTransactionAlreadyExist);
            }

            var innerTransaction = Connection.BeginTransaction();

            _transaction = new SessionTransactionWrapper(this, innerTransaction);
            return(_transaction);
        }