Re: Accessing session from thread



Thanks John,

But a snapshot won't allow me to signal things from inside the worker thread
to the main threads (other aspx pages). For me the problem is outgoing
information, not incomming.

The only strategy I can see is to use the database - which seems a bit
over-powered for the job!

John


"John Timney ( MVP )" <timneyj@xxxxxxxxxxxxx> wrote in message
news:erg07uf8FHA.3544@xxxxxxxxxxxxxxxxxxxxxxx
> As long as the pipeline is still active, then the context of the session
> may be available, but its always a risky thing to rely on, and you might
> be better taking a snapshot of session items into a collection at thread
> start and passing that to the thread, rather than maintaining access to
> the live session.
>
> Read this for a pointer:
>
> http://www.odetocode.com/Articles/112.aspx
>
> --
> Regards
>
> John Timney
> ASP.NET MVP
> Microsoft Regional Director
>
> "John" <jsparrowNOSPAM@xxxxxxxxxxxxxxxxxxxxxxxxxxxxx> wrote in message
> news:uLLhtNf8FHA.956@xxxxxxxxxxxxxxxxxxxxxxx
>> Is there a safe way to gain access to the session object from inside a
>> spawned thread, in ASP.NET?
>>
>> I'm familiar with the principle of creating a data storage object,
>> passing a reference to the thread, and then adding the object to the
>> session. But this won't work when using StateServer because of
>> serialization (session only contains a snapshop of the object at the
>> point I added it, and the changes made by the thread occur elsewhere).
>>
>> Ideally I'd like:
>>
>> void MyThreadWorker()
>> {
>> HttpSession sess = somemagicroutine();
>> sess["counter"] = 1;
>> }
>>
>> Thanks,
>>
>> John
>>
>
>


.



Relevant Pages

  • Re: EMC CXseries and snapview
    ... What i first thought was you could take a snapshot and that would be ... Would one start a session and keep taking snapshots ... A SnapView "session" is what ... represents the point in time copy of a single LUN or multiple LUNs. ...
    (comp.arch.storage)
  • Re: EMC CXseries and snapview
    ... Would one start a session and keep taking snapshots ... A SnapView "session" is what represents the point in time copy of a single LUN or multiple LUNs. ... Each of the LUNs in the session has also has a "snapshot", which you can manipulate with Navisphere as if they are individual LUNs themselves. ...
    (comp.arch.storage)
  • Re: [SLE] Startup aplications
    ... session management may be confusing if you have not seen it before. ... Basically, KDE will take a "snapshot" of all the programs currently running, ... and restore those programs next time it is started. ... Next time KDE starts, they will open on desktop 1. ...
    (SuSE)
  • Re: A Toot and a Snore in 74 is a rare bootleg alb...
    ... First mentioned by Lennon in a 1975 ... Loving John -- and it gained wider prominence when McCartney made ... reference to the session in a 1997 interview. ...
    (rec.music.beatles)
  • Re: Web Farms and session handling
    ... > Hi John, ... > with our own custom module, that may help implement our own session ... your current server should hardly notice it. ... > |> Our setup is with a web farm, one ldap server and a database cluster. ...
    (microsoft.public.dotnet.framework.aspnet)