Nhibernate transactions:Avoiding Nhibernate dependency in the service layer

Posted by Quintin Par on Stack Overflow See other posts from Stack Overflow or by Quintin Par
Published on 2010-03-30T18:17:51Z Indexed on 2010/03/30 21:43 UTC
Read the original article Hit count: 687

One of practices advocated by Nhibernate experts is to do all actions in inside a transaction.

In a typical 3 tier web architecture, Nhibernate depedency is limited the data layer.

In such a case is it fine to use

  using (var tr = NHibernateSession.Current.BeginTransaction()) {

at the controller level. Won’t this bring in a dependency on Nhibernate to the service layer?

© Stack Overflow or respective owner

Related posts about nhibernate

Related posts about transactions