hmmm.

is it like in one session you can have multiple instances of the bean, with
different values???

if not,
 instead of static, use session variable.
you can make your method synchronized and inside that set/get the session
variable and make it required that any action would check for this static
variable first before doing anything else.
in this way at any instance only one action will be setting/getting the
values and another action will get the new value.




----- Original Message -----
From: "Gogineni, Pratima" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Monday, July 16, 2001 1:44 PM
Subject: RE: thread problems?


> No I cant have a static variable - there could be more than one instance
of
> the bean each with a different number of values.
>
> -----Original Message-----
> From: Rama Krishna [mailto:[EMAIL PROTECTED]]
> Sent: Monday, July 16, 2001 1:42 PM
> To: [EMAIL PROTECTED]
> Subject: Re: thread problems?
>
>
> may be you can have some static variable pointing to the no. of values and
> check this before you construct your bean. if you think two threads access
> this to update this then it can be synchronized. this variable need not be
> in the same class.
>
>
>
>
> ----- Original Message -----
> From: "Gogineni, Pratima" <[EMAIL PROTECTED]>
> To: <[EMAIL PROTECTED]>
> Sent: Monday, July 16, 2001 1:21 PM
> Subject: RE: thread problems?
>
>
> > I just put in an error message saying you are asking for something that
> > doesnt exist - I never really expected to see this scenario when I put
in
> > this message. The arrayIndexOutofBounds happens if I dont catch htis
case.
> >
> > Let me put it this way: I am displaying values 1-10 in a page. I post an
> > action that changes the number of values to be displayed to 5 so a new
> bean
> > with just five values is manufactured and put in the session - in the
> > meanwhile the second click is forwarded by the actionservlet through the
> > requestUtils to the BeanUtil to look for the accessors and mutators for
> > values 1-10 but we have now have only 5 values in the bean so this is an
> > error condition.
> >
> > The properties object sent to the BeanUtil seems to be sent from the old
> > form bean which had 10 values but the new form bean has only 5 values
> >
> > -----Original Message-----
> > From: David Winterfeldt [mailto:[EMAIL PROTECTED]]
> > Sent: Monday, July 16, 2001 11:52 AM
> > To: [EMAIL PROTECTED]
> > Subject: Re: thread problems?
> >
> >
> > It sounds like you are throwing an Exception of some
> > sort from you ActionForm?  Is that right?  The
> > ActionForm should just be a container to hold the
> > values from the form.
> >
> > David
> >
> > --- "Gogineni, Pratima" <[EMAIL PROTECTED]>
> > wrote:
> > > Hi,
> > >
> > > I have been fighting with the following situation
> > > and would appreciate any
> > > ideas/suggestions.
> > >
> > > I have a session scoped form bean "FBean", a jsp
> > > page that displays it
> > > "dispFBean" & an action FBeanAction.
> > >
> > > I have inserted transactional tokens to take care of
> > > duplicate posting.
> > >
> > > After changing a value in dispFBean, an enter or/and
> > > a click work fine &
> > > they do the same thing ie. call FBeanAction.
> > >
> > > when the 2 events are done in rapid succession - one
> > > event executes fine
> > > while the other event throws an exception because it
> > > is trying to access
> > > row#5 where as the previous action changed the
> > > number of rows to 4.
> > > Unfortunately the transactional tokens cant take
> > > care of this since this
> > > error is being thrown in BeanUtils.populate before
> > > it ever reaches an
> > > FBeanAction instance.
> > >
> > > I also tried declaring the jsp page threadsafe to
> > > check if that is the
> > > problem.
> > >
> > > Also note that the FBeanAction replaces FBean with a
> > > new Instance of FBean.
> > >
> > > Thanks
> > > Pratima
> >
> >
> > __________________________________________________
> > Do You Yahoo!?
> > Get personalized email addresses from Yahoo! Mail
> > http://personal.mail.yahoo.com/
> >
>

Reply via email to