Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

NHibernate.Burrow For Session Management In NH3

I first would like to ask if NHibernate.Burrow works with NHibernate 3.0 (Linq). I would like to use this framework to delegate the complex session handling things to it and just concentrate in the project I'm working on.

Also, what other frameworks are out there easy to configure like Burrow to handle NHibernate sessions? I know Burrow is a project discontinued back in 2009. If there is none, then what is an easy but effective way to implement a session handler? I've read some articles but involves getting deep in dependency injection and configuring a thousand libraries to get the job done. I've heard that a singleton approach is rather problematic on concurrency.

Thanks!

like image 251
Luis Aguilar Avatar asked Nov 05 '22 01:11

Luis Aguilar


1 Answers

For the most light weight NHibernate session management I would follow Ayende's excellent posts on the matter.

These posts will guide you through the process of creating just two classes to handle the NHibernate Session Management and Configuration.

In the end you end up with a simple ActionFilterAttribute which handle the session, configuration and transaction management and a base controller class where you can get hold of the current session.

  1. Refactoring toward frictionless & odorless code: The baseline
  2. Refactoring toward frictionless & odorless code: Hiding global state
  3. Refactoring toward frictionless & odorless code: Limiting session scope
  4. Refactoring toward frictionless & odorless code: A broken home (controller)
  5. Refactoring toward frictionless & odorless code: The case for the view model
  6. Refactoring toward frictionless & odorless code: Getting rid of globals
  7. Refactoring toward frictionless & odorless code: What about transactions?
like image 125
Mark Perry Avatar answered Nov 15 '22 12:11

Mark Perry