Thanks for your suggestion Martin. I understand that nothing is preserved
between requests.
I have a fix (that I dont like) temporarily. I can detail below exactly
what is happening and what the three solutions I could think of were and the
one that I choose implement as a temporary fix. Would be glad to knwo what
people think of it.
My form bean has indexed properties that are displayed/modified in the jsp
page. The valid indices on this property can change between requests. When
the ActionServlet recieves a request - it sets all the properties on my form
bean. Now when I manage to send multiple requests from the browser almost
simultaneously - the first request executes properly as a result the valid
indices on my bean have changed. Now the second request is handled by the
actionservlet and it trys to set the same properties as the first one on the
form bean but unfortunately the valid indices have changed and there is an
error.
I was thinking that if the transactional tokens were checked in the
ActionServlet itself this problem would not have occurred.
Another possibility was modify the bean utils so that for indexed propertys
no errors are thrown if the indices have changed (I dont like this very
much). Or alternatively redirect back to the input page from here.
The third possibilty which I used as a temporary fix is this: In actionform
if an indexed proprety value outside its range is being set - dont throw an
error - Just do Nothing.
And the above solution works fine.
Thanks
Pratima
-----Original Message-----
From: Martin Cooper [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, July 17, 2001 12:02 AM
To: Gogineni, Pratima
Cc: [EMAIL PROTECTED]
Subject: Re: thread problems?
I believe your problems are caused by your assumptions about the
preservation (or otherwise) of state between requests. Nothing is guaranteed
to be preserved unless you write code to make those guarantees.
--
Martin Cooper
----- Original Message -----
From: "Gogineni, Pratima" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Monday, July 16, 2001 11:43 AM
Subject: thread problems?
> 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
>