Beispiel #1
0
        private void DisposeTransaction()
        {
            if (_transaction == null) return;

            _transaction.Dispose();
            _transaction = null;
        }
Beispiel #2
0
        public ITransaction BeginTransaction(IsolationLevel isolationLevel)
        {
            if (_transaction != null)
                throw new InvalidOperationException("A transaction is already in progress and a new one cannot be started.");

            _transaction = new NHibernateTransaction(_session.BeginTransaction(isolationLevel),
                committed => DisposeTransaction(),
                aborted => DisposeTransaction());

            return _transaction;
        }