spring.net nhibernate session/transaction per request

人盡茶涼 提交于 2020-01-05 07:40:07

问题


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

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?


回答1:


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.

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.



来源:https://stackoverflow.com/questions/6691506/spring-net-nhibernate-session-transaction-per-request

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!