title: Nhibernate session management strategy for web application with background-workers?
body: <p>For a web application, it seems like a good way to handle the session is to use the setting <code>&lt;property name="current_session_context_class"&gt;managed_web&lt;/property&gt;</code>, call <code>CurrentSessionContext.Bind/Unbind</code> on Begin/EndRequest. Then I can just use <code>sessionFactory.GetCurrentSession()</code> in the repository class.</p>
  
  <p>This works fine for all page request. But I have background workers doing stuff and using the same repository classes to do stuff. These do not run within a web request, so that session handling won't work.</p>
  
  <p>Any suggestions to how this can be solved?</p>