本文介绍了每个请求spring.net的NHibernate会话/事务的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

是否Spring.NET与NHibernate的任何支持(整合),将每个请求的ISession和交易?

Does Spring.NET have any support (integration) with NHibernate that would eneble per request ISession and transactions?

我foung ,但它是一个有点老,所以我想知道,如果事情已经向前移动了一点,可这已经集成在Spring框架,我只能用一些配置设置?

I foung this blog, but it is a bit old one so I want to know if things have moved forward a bit and may be this is already integrated in Spring framework and I can only set it up with some configuration?

推荐答案

是它,它被称为鉴于公开会议。交易支持是太多,但它不是自动每个请求一个事务。

Yes it has, it's called "open session in view". Transaction support is available too, but it's not automatically "one transaction per request".

我认为的好地方,你开始会。这两个概念是有解释的。

I think a good place for you to start would be the NHibernate quickstart in the Spring documentation. Both concepts are explained there.

只有只注意到了asp.net MVC的标签;我认为它应该工作,但我不能肯定。如果你正在使用asp.net MVC 3,你应该使用春1.3.2 ,这是由于近期发布。

Only just noticed the asp.net MVC tag; I think it should work, but I'm not quite sure. If you're using asp.net MVC 3, you should use Spring 1.3.2, which is due to release soon.

这篇关于每个请求spring.net的NHibernate会话/事务的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

08-24 00:17