Hi, I've been wondering how could I pass and object from layer to layer with
threads. I need this in conjunction with ASP.NET. Here my problem:



I've been using NHibernate to manage my persistence. The issue is I need to
open and close a NH Session with each request (AKA session-per-request
pattern), but this session object needs to be sent down to a framework layer
that actually uses it for queries, updates, etc. I've been reading a bit and
found that I should be able to do so using thread local storage.



The problem is, ASP.NET uses a thread pool so I'm no guaranteed to get the
same thread each time I connect. I was wondering how HTTPContext works. If I
put something in there with HTTPContext.Item is there a way to retrieve it
later down the road (another DLL).



I've been banging my head for a couple of days now and in a hurry.



Thanks!


===================================
This list is hosted by DevelopMentor�  http://www.develop.com

View archives and manage your subscription(s) at http://discuss.develop.com

Reply via email to