drorwe wrote:
When I open a session is a database connection created or does NHibernate work with some kind of connection pool and assigns the session a connection from the pool?
NHibernate depends on the specific ADO.NET providers for connection pooling. Most providers do connection pooling by default, so in those cases, the connections used by the Sessions are also pooled.
Quote:
Is it reasonable from performance and scalability point of view to have my Data Access Layer open a session upon each request, use it to retrieve the object and then immediately close it?
From the system design point of view it seems most sensible to me because I don't want the service and UI layers who use to Data Access Layer to be aware of sessions or use any NHibernate APIs.
I'm aware of the lazy loading concerns - I just might use the
reattachment method I found in the forum or some another technique.
Since you're aware of the potential drawbacks, I think it's fine to do it this way.