This is HORRIBLE.
You micro manage the session and remove from NH things like UoW, auto change
tracking, persistence by reachability, etc.
Sessions should be managed by request / context, not in methods.

On Fri, Sep 18, 2009 at 4:25 PM, Martin Nilsson <[email protected]> wrote:

>
> ProductService:
> public void Save(Product product) {
>   using(var session = ?.GetSession)
>   using(var tx = session.BeginTransaction())
>   {
>     repository.Add(product);
>     tx.Commit();
>   }
> }
>
>

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Rhino Tools Dev" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/rhino-tools-dev?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to