Just a quick clarification:

As Grace points out, the CP Worker is multi-threaded.

Thus, you don't actually have exclusive access to the CP worker during the web
event
(this is why there can be multi-threading issues with static methods/variables).

You -do-, however, have exclusive access to your copy of the project graph
during a web event -- for each thread within the CP Worker, there is a separate
project graph created.

Thus, for almost anything except static variable accesses, or the use of
outside custom classes, you can treat the environment as single-threaded.

-- David.


                                                                  
 (Embedded                                                        
 image moved   [EMAIL PROTECTED]                                  
 to file:      07/23/99 07:12 AM                                  
 pic02537.pcx)                                                    
                                                                  



To:   [EMAIL PROTECTED]
cc:    (bcc: David P Caldwell/GL/KSC/KeyCorp)
Subject:  Re: [ND] Users are seeing each other pages




Keep in mind that pages are generated by the CP which can be multi-process
(multiple CPs) and multi-threaded (multiple CP Workers).  As page requests
come into the ND server, the requests are doled out to the various CP
Workers so that every request gets generated as fast as possible.
Therefore, you can't guarantee which CP Worker is going to process any given
page request.  Fortunately, ND is designed such that you have exclusive use
of a CP Worker from the beginning of the web event (page request) to the end
of the web event (page returned).

So, while you can use instance variables during a web event, you can't
depend of the values across multiple web events.  If you are using a value
that you want to keep around for the next page request, you need to put it
in a session object.  If you don't care to save the value for the next page
request but want the variable reset, then you can reset the variable in one
of the events at the top of the ND event order.

I typically do the following
- reset the instance variable in this_onBeforeDisplayEvent either by setting
them to a static value or by getting a session object value.
- use the instance variable throughout the methods within the page class
- if necessary, save the instance variable by putting a session object value

BTW, if all of this seems a bit clunky, remember two things:
1.  This isn't client/server programming
2.  Other technologies for web application development are such that you
can't use instance variables at all.  Everything has to be shoved in some
sort of session management buffer.  (Talk about painful!)

Hope that helps.

-- Grace


LadyNaureen <[EMAIL PROTECTED]> wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
>
> Dear ND Experts
>
> Hello to All,
>
> The problem scenario is I have a variable that is used by all functions in
a page.
> For the  first time the project starts nicely, moving initializing value
in this
> variable. But if I rerun my application then the  old value of the
variable is retrieved,
> so my application goes down. Anyone knows why this is happening????
> Thanks in advance.
>
> Regards,
> LadyNaureen
>
> _________________________________________________________________________
>
> For help in using, subscribing, and unsubscribing to the discussion
> forums, please go to: http://www.netdynamics.com/support/visitdevfor.html
>
> For dire need help, email: [EMAIL PROTECTED]
>


_________________________________________________________________________

For help in using, subscribing, and unsubscribing to the discussion
forums, please go to: http://www.netdynamics.com/support/visitdevfor.html

For dire need help, email: [EMAIL PROTECTED]


pic02537.pcx

Reply via email to