SessionScope 与 ISession 完全相同吗?

发布于 2024-09-25 23:45:25 字数 122 浏览 1 评论 0原文

Castle ActiveRecord 的 SessionScope 与 NHibernate 的 ISession 完全相同吗?如果是,为什么 Castle ActiveRecord 提供了重复功能?如果不是,它们的区别是什么?

Is Castle ActiveRecord's SessionScope exact equivalent of NHibernate's ISession? If yes, why Castle ActiveRecord has provided a duplicate feature? If no, what are their differences?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

悲念泪 2024-10-02 23:45:25

SessionScope 基本上是 NHibernate 的 ISession 的包装器。它作为环境会话工作,也就是说,存在隐式“当前”SessionScope 的概念,它是可堆叠的,并且其存储可通过 IThreadScopeInfo 的实现进行配置,如 ThreadScopeInfo、WebThreadScopeInfo 和 HybridWebThreadScopeInfo。这类似于 NHibernate 的上下文会话,但是 ActiveRecord 有将此概念扩展到范围的其他实现,例如 TransactionScope 和 ConversationalScope。

ActiveRecord 文档中的更多信息:

SessionScope is basically a wrapper around NHibernate's ISession. It works as an ambient session, that is, there is the notion of an implicit "current" SessionScope, it's stackable and its storage is configurable via implementations of IThreadScopeInfo, like ThreadScopeInfo, WebThreadScopeInfo, and HybridWebThreadScopeInfo. This is similar to NHibernate's contextual sessions, however ActiveRecord has extended this concept to other implementations of scopes, such as TransactionScope and ConversationalScope.

More information in the ActiveRecord docs:

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文