日期:2014-05-17 浏览次数:20608 次
public class NHibernateHelper
{
private static ISessionFactory _sessionFactory;
private static object _sessionFactoryObj = new object();
private static ValidatorEngine _tor;
private static object _torObj = new object();
private NHibernateHelper() { }
static NHibernateHelper()
{
log4net.Config.XmlConfigurator.Configure();
log4net.ILog logger = log4net.LogManager.GetLogger("File");
logger.Info("自定义记录错误日志:11111111111111111111111111111111111111111111111" + DateTime.Now.ToString());
}
private static ISessionFactory SessionFactory
{
get
{
if (_sessionFactory == null)
{
lock (_sessionFactoryObj)
{
if (_sessionFactory == null)
{
NHibernate.Cfg.Configuration cfg = new NHibernate.Cfg.Configuration();
cfg.AddAssembly("Com.Richfit.A1.DMS.DataProvider.DataAccess");
_sessionFactory = cfg.BuildSessionFactory();
}
}
}
return _sessionFactory;
&n