don't put code in the constructor. it's not
so much that it's multi-user, it's that it's
multi-threaded.
ND clones objects into subsequent threads
within worker VMs and the constructor
doesn't get executed. The way we've
accomplished what you're wanting to do is to
override public int init() in the page:
public int init()
{
//set instance variables
return super.init();
}
This method gets called after the object is
cloned in the new thread.
-Chip
Team NetDynamics
"Teplitsky, Alexander" <[EMAIL PROTECTED]> wrote:
>I have a class defined as follows:
>
>public class Page extends CSpPage
>{
> // instance var:
> private boolean _brefresh = true; // also tried it declared as
>transient
>
> // constructor
> public Page()
> {
> super();
> }
>
> // method
> public void setRefresh(arg)
> {
> _brefresh = arg;
> }
>}
>
>The constructor sets _brefresh = true, but then elsewhere in the code I can
>have
>
>p.SetRefresh(false);
>
>and the next user of this page has it false until this or some other user
>executes setRefresh(true). In multiuser environment such behavior breaks my
>logic. My first thought was that ND serializes the entire class and I tried
>declaring _brefresh as transient, but that didn't preserve the value of
>_brefresh from session to session.
>I guess putUserSessionObject() or putPageSessionObject() will work but I
>would prefer to stick with using instance variables if possible. I am
>wondering if anyone out there knows of any trick that accomplishes that.
>If you know for sure that putXXXSessionObject() is the only way to go then I
>would appreciate your e-mail confirming that.
>
>Thanks
_________________________________________________________________________
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]