摘要:
NHibernate中Session是线程不安全的,而且每次数据库操作 请求创建Session时对性能有些影响。在Windows应用中可以通过 [ThreadStatic]特性很简单的就可以实现线程安全,而在Web中可以通过将Session与用于请求HttpContext绑定实现线程安全,并且用户当... 阅读全文
posted @ 2015-07-08 21:38
awp110
阅读(926)
评论(1)
推荐(0)
摘要:
So here is my current UnitOfWork implementation. This one makes use of the somewhat new current_session_context_class feature. I think this is quite s... 阅读全文
posted @ 2015-07-08 13:28
awp110
阅读(177)
评论(0)
推荐(0)
摘要:
Contains 缓存中是否存在SessionFactoryBizCom.GetInstance().GetCurrentSession().Contains(t1)Evict临时状态(Transient):当new一个实体对象后,这个对象处于临时状态,即这个对象只是一个保存临时数据的内存区域,如果... 阅读全文
posted @ 2015-07-08 09:25
awp110
阅读(225)
评论(0)
推荐(0)