【发布时间】:2010-10-02 09:50:19
【问题描述】:
Castle ActiveRecord 的 SessionScope 是否完全等同于 NHibernate 的 ISession?如果是,为什么 Castle ActiveRecord 提供了重复的功能?如果不是,它们的区别是什么?
【问题讨论】:
标签: nhibernate castle-activerecord isession session-scope
Castle ActiveRecord 的 SessionScope 是否完全等同于 NHibernate 的 ISession?如果是,为什么 Castle ActiveRecord 提供了重复的功能?如果不是,它们的区别是什么?
【问题讨论】:
标签: nhibernate castle-activerecord isession session-scope
SessionScope 基本上是 NHibernate 的 ISession 的包装器。它作为一个环境会话工作,也就是说,有一个隐含的“当前”SessionScope 的概念,它是可堆叠的,并且它的存储可以通过 IThreadScopeInfo 的实现来配置,例如 ThreadScopeInfo、WebThreadScopeInfo 和 HybridWebThreadScopeInfo。这类似于NHibernate's contextual sessions,但 ActiveRecord 已将此概念扩展到范围的其他实现,例如 TransactionScope 和 ConversationalScope。
ActiveRecord 文档中的更多信息:
【讨论】: