I've seen many similar questions about NHibernate session management (so I know I'm not alone) but no answers that address abstracting the details of session management from other layers.
In simple terms, I have a Domain layer that has objects like Customer, Product, and Order. I have an Integration layer that that defines services for the application like IOrderEntryService containing methods like Get<Product>(int id) or Get<Customer>(int id) and Get<Order>(int id). I have a business rules layer that uses these services to get Customers, Orders, etc. Business rules use only the service interfaces to avoid hard dependencies on any specific service implementation.
I can implement IOrderEntryService with NHibernate and define mappings to support properties like Customer.Orders as well as Order.Customer and similar associations using lazy loading. In my implementation of Get<Customer>(int id) I open an ISession object, obtain a Customer and then dispose my ISession. Later, if I reference Customer.Orders, I receive an exception, because there is no current session. I understand the reasons for this, but I'm having difficulty finding a workaround that doesn't bind higher layers to NHibernate. All the examples I've found suggest methods for obtaining an NHibernate.ISession per request so that the session remains open during the full request lifetime. I struggle with this, because this binds higher layers to the NHibernate ISession object.
Is there an abstract way to manage "sessions" that does not bind higher layers to NHibernate?