//HACK:陈春伟 陈春伟 暂不支持 多个事务
 public static ITransaction BeginTransaction()
 {
     var sessionFactoryHelper = new DefaultSessionFactoryHelper();
     var defaultSessionFactory = new DefaultSessionManagerFactory(sessionFactoryHelper.GetSessionFactory());
     var session = defaultSessionFactory.CreateManager().OpenSession();
     return session.Transaction.IsActive ? new EmptySessionTransaction() : session.BeginTransaction();
 }
Ejemplo n.º 2
0
        //HACK:陈春伟 陈春伟 暂不支持 多个事务
        public static ITransaction BeginTransaction()
        {
            var sessionFactoryHelper  = new DefaultSessionFactoryHelper();
            var defaultSessionFactory = new DefaultSessionManagerFactory(sessionFactoryHelper.GetSessionFactory());
            var session = defaultSessionFactory.CreateManager().OpenSession();

            return(session.Transaction.IsActive ? new EmptySessionTransaction() : session.BeginTransaction());
        }
Ejemplo n.º 3
0
 public AbstractNhibernateRepository()
 {
     _defaultSessionFactoryHelper = new DefaultSessionFactoryHelper();
     _sessionManagerFactory       = new DefaultSessionManagerFactory(_defaultSessionFactoryHelper.GetSessionFactory());
 }