Example #1
0
        public override ISessionFactory GetSessionFactory()
        {
            string connectionString = Configuration.Properties[NHibernate.Cfg.Environment.ConnectionString];

            _openConnection = new SQLiteConnection(connectionString);
            _openConnection.Open();

            BuildSchema(Configuration, _openConnection);

            _innerSessionFactory = base.GetSessionFactory();
            _innerSessionFactory.OpenSession(_openConnection);

            _sessionFactory = new SingleConnectionSessionFactory(_innerSessionFactory, _openConnection);

            return(_sessionFactory);
        }
        public override ISessionFactory GetSessionFactory()
        {
            string connectionString = Configuration.Properties[NHibernate.Cfg.Environment.ConnectionString];
            _openConnection = new SQLiteConnection(connectionString);
            _openConnection.Open();

            BuildSchema(Configuration, _openConnection);

            _innerSessionFactory = base.GetSessionFactory();
            _innerSessionFactory.OpenSession(_openConnection);

            _sessionFactory = new SingleConnectionSessionFactory(_innerSessionFactory, _openConnection);

            return _sessionFactory;
        }