Ask a Question related to ASP.NET General, Design and Development.
-
David Browne #1
Re: Sessions variable access in multithreaded asp.net
"Kelvin Foo Chuan Lyi" <vm@vmirage.cjb.net> wrote in message
news:3c84a272.0307280615.48cb160f@posting.google.c om...If you are getting the error> Hi guys,
>
> I've got a problem accessing Session variable in a thread. I keep
> getting this serialization error thinggy... I'm using c# ... but i've
> seen source accessing Sessions in threads using VB.Net .... odd...
>
> my code looks some what like this...
>
>
> private void MyThread()
> {
> Session["test"] = "testing";
> }
>
> note: MyThread is called by Thread.Start()
>
> i get this serialization error... um... forgot what error it was...
> but it states that blah blah blah... does not support serialization
> or somewhat like that... hmm... thread doesn't support serialization
> rite? But using VB.Net ... i won't get such error... why? Any work
> around for this?
>
that blah blah blah...
I suggest you figure it out yourself, and stop wasting everyone's time.
Alternatively, you could post sample code and a real error message, and
perhaps someone will help you.
David
David Browne Guest
-
Sessions Variable
HI everyone Been trying to get sessions variables happening have set up a collection called 'shoppingcart' now im trying to get my add button to... -
CSharpCorner Just Published My Article : Multithreaded XML Documentfor Read/Write Access
Check me out: http://www.c-sharpcorner.com/Code/2004/July/MultithreadedXmlDoc.asp Multithreaded XML Document for Read/Write Access by John... -
HELP : problem with sessions, and php code stored within a variable
I am getting the following error on a peice of code of mine: Parse error: parse error, unexpected T_ENCAPSED_AND_WHITESPACE, expecting T_STRING or... -
#26093 [NEW]: access variable cause access violation
From: bruno dot faust at ig dot com dot br Operating system: XP SP1 latest PHP version: 4.3.3 PHP Bug Type: Reproducible... -
Sessions variable HELP please
Hi Can Someone tell me why This doesnąt work: Page 1 $_SESSION = 'A non'; Page 2 Echo $_SESSION; -
Natty Gur #2
Re: Sessions variable access in multithreaded asp.net
Hi,
As far as I know you can’t access Session from another thread directly
or by using HttpContext.Current, you should get null from
HttpContext.Current. The work around that I use is to pass the Context
as parameter to the thread.
see my sample : [url]http://www.developersdex.com/gurus/code/662.asp[/url].
Natty Gur, CTO
Dao2Com Ltd.
28th Baruch Hirsch st. Bnei-Brak
Israel , 51114
Phone Numbers:
Office: +972-(0)3-5786668
Fax: +972-(0)3-5703475
Mobile: +972-(0)58-888377
Know the overall picture
*** Sent via Developersdex [url]http://www.developersdex.com[/url] ***
Don't just participate in USENET...get rewarded for it!
Natty Gur Guest
-
Kelvin Foo Chuan Lyi #3
Re: Sessions variable access in multithreaded asp.net
>
sorry dude... but my source code was in my office ... and i'm writing> If you are getting the error
>
> that blah blah blah...
>
> I suggest you figure it out yourself, and stop wasting everyone's time.
>
> Alternatively, you could post sample code and a real error message, and
> perhaps someone will help you.
>
> David
the message at home... and i can remember a little of what happened in
my brain... :P
Kelvin Foo Chuan Lyi Guest
-
Kelvin Foo Chuan Lyi #4
Re: Sessions variable access in multithreaded asp.net
Hi,
Thanks, but i noticed that u need to have the Join method or else the
HttpContext.Session will still be null. Wouldn't that defeat the
purpose of multithreading then?
Natty Gur <natty@dao2com.com> wrote in message news:<esBz04RVDHA.3220@tk2msftngp13.phx.gbl>...> Hi,
>
> As far as I know you can?t access Session from another thread directly
> or by using HttpContext.Current, you should get null from
> HttpContext.Current. The work around that I use is to pass the Context
> as parameter to the thread.
>
> see my sample : [url]http://www.developersdex.com/gurus/code/662.asp[/url].
>
> Natty Gur, CTO
> Dao2Com Ltd.
> 28th Baruch Hirsch st. Bnei-Brak
> Israel , 51114
>
> Phone Numbers:
> Office: +972-(0)3-5786668
> Fax: +972-(0)3-5703475
> Mobile: +972-(0)58-888377
>
> Know the overall picture
>
>
> *** Sent via Developersdex [url]http://www.developersdex.com[/url] ***
> Don't just participate in USENET...get rewarded for it!Kelvin Foo Chuan Lyi Guest
-
Natty Gur #5
Re: Sessions variable access in multithreaded asp.net
Hi,
You dont have to use the join method ...
Natty Gur, CTO
Dao2Com Ltd.
28th Baruch Hirsch st. Bnei-Brak
Israel , 51114
Phone Numbers:
Office: +972-(0)3-5786668
Fax: +972-(0)3-5703475
Mobile: +972-(0)58-888377
Know the overall picture
*** Sent via Developersdex [url]http://www.developersdex.com[/url] ***
Don't just participate in USENET...get rewarded for it!
Natty Gur Guest
-
Naveen K Kohli #6
Re: Sessions variable access in multithreaded asp.net
If you spawn the thread and don't wait, then whats the point. The page will
get served without your thread ever getting back. Then all the processing
that you are doing in the thread is waste. At some point you will have to
wait for the threrad to finish execution.
--
Naveen K Kohli
[url]http://www.netomatix.com[/url]
"Kelvin Foo Chuan Lyi" <vm@vmirage.cjb.net> wrote in message
news:3c84a272.0307282134.7ea4025b@posting.google.c om...news:<esBz04RVDHA.3220@tk2msftngp13.phx.gbl>...> Hi,
>
> Thanks, but i noticed that u need to have the Join method or else the
> HttpContext.Session will still be null. Wouldn't that defeat the
> purpose of multithreading then?
>
> Natty Gur <natty@dao2com.com> wrote in message> > Hi,
> >
> > As far as I know you can?t access Session from another thread directly
> > or by using HttpContext.Current, you should get null from
> > HttpContext.Current. The work around that I use is to pass the Context
> > as parameter to the thread.
> >
> > see my sample : [url]http://www.developersdex.com/gurus/code/662.asp[/url].
> >
> > Natty Gur, CTO
> > Dao2Com Ltd.
> > 28th Baruch Hirsch st. Bnei-Brak
> > Israel , 51114
> >
> > Phone Numbers:
> > Office: +972-(0)3-5786668
> > Fax: +972-(0)3-5703475
> > Mobile: +972-(0)58-888377
> >
> > Know the overall picture
> >
> >
> > *** Sent via Developersdex [url]http://www.developersdex.com[/url] ***
> > Don't just participate in USENET...get rewarded for it!
Naveen K Kohli Guest



Reply With Quote

