Just more details about what I am planning to do.
Each session will only have one item in HttpContext.Current.Items.
Therefore, the session ID will be the key for the item.
I embedded the session ID into the file name of dynamic page request so
that I can retrieve the session ID then retrieve the value I stored in
HttpContext.Current.Items.
A number of sessions might add new items, retrieve items from
HttpContext.Current.Items at the same time (Of course with different
keys), do I need to worry about concurrent access issue from different
threads or the threading issue is handled inside the directory object?
Thanks
Charles Zhang
> I think HttpContext.Current.Items will do the trick for me? However, how
> could I deal with thread issue or do I need to worry about threading at
[quoted text clipped - 32 lines]
>> This posting is provided "AS IS" with no warranties, and confers no
>> rights.
Walter Wang [MSFT] - 18 Jun 2007 09:38 GMT
Hi Charles,
The HttpContext.Current is per-request, which means every worker thread has
its own Items collection; therefore different request/session will have
their own HttpContext.Current. If you spawn a new background thread from
the worker thread that is currently handling the request, the background
thread will not have this HttpContext.Current.
This also means a second request issued by the same user/session will also
have an brand new HttpContext.Current. This is different from how session
state works across different requests. From your previous code, it seems
you're only saving the state at the beginning of each request and use it
from the dynamic web page, that's why I suggested to use it; otherwise it
will not work if you need to access previous state in
VirtualPathProvider/VirtualFile.
Following are some reference articles you may find useful on
HttpContext/CallContext:
#Working With HttpContext.Current
http://www.odetocode.com/Articles/112.aspx
Regards,
Walter Wang (wawang@online.microsoft.com, remove 'online.')
Microsoft Online Community Support
==================================================
When responding to posts, please "Reply to Group" via your newsreader so
that others may learn and benefit from your issue.
==================================================
This posting is provided "AS IS" with no warranties, and confers no rights.
Walter Wang [MSFT] - 21 Jun 2007 04:15 GMT
Hi Charles,
Let me know if you have further questions. Thanks.
Regards,
Walter Wang (wawang@online.microsoft.com, remove 'online.')
Microsoft Online Community Support
==================================================
When responding to posts, please "Reply to Group" via your newsreader so
that others may learn and benefit from your issue.
==================================================
This posting is provided "AS IS" with no warranties, and confers no rights.