Beispiel #1
0
        public void Initialize()
        {
            should_not_currently_be_disposed();

            CurrentSession = _nHibernateSessionFactory.CreateSession();
            begin_new_transaction();

            _isInitialized = true;
        }
Beispiel #2
0
        public void Start()
        {
            AssertIsNotDisposed();
            AssertIsNotStarted();

            _currentSession = _sessionFactory.CreateSession();
            StartNewTransaction();

            IsStarted = true;
        }
        public ISession OpenSession()
        {
            if (Current != null)
            {
                throw new InvalidOperationException("There is already an active ISession instance for this thread");
            }

            var cur = _sessionFactory.CreateSession();

            cur.FlushMode = FlushMode.Never; //readonly by default
            Current       = cur;
            return(cur);
        }
Beispiel #4
0
 public DbConversation(INHibernateSessionFactory sessionFactory)
 {
     _session = sessionFactory.CreateSession();
 }