Hmm, I think the JSF spec has a flaw concerning this. The problem is not the component itself, but the way the iteration is done.
As e result you are not allowed to:
1. bind the component to session or application scoped backing bean
2. provide a session or spplication scoped DataModel
Synchonizing access to session objects isn't that complicated, but providing a thread-safe session scoped DataModel is really hard.
Silmply synchronizing isn't sufficent because UIData first sets the row for processing and then retrieves the data. So you have to save the current row for every thread. :(
Alternatively you could return a individual DataModel for every thread sharing the same data.
I have the feeling that easy thread-safe coding was not the goal while developing the framework.
Regards,
Mathias Werlitz
[EMAIL PROTECTED] schrieb am 09.11.2005 09:26:09:
> You'll need to synchronize access to your session objects - there
> really is not much way around it.
>
> Alternative is to have everything client side, then you don't have any
> problems on the server.
>
> Except the performance, of course ;)
>
> regards,
>
> Martin
>
> On 11/9/05, Simon Kitching <[EMAIL PROTECTED]> wrote:
> > Hi,
> >
> > I've noticed that if I click multiple times on a component that does a
> > submit then quite often I get an exception generated in the server.
> >
> > The most obvious case for me is a table with a sortable header; if I
> > pretend to be impatient and click several times on the sort header then
> > usually I end up with an exception page.
> >
> > I believe the cause is that the browser has submitted several concurrent
> > post requests to the server; multiple threads within the server then try
> > to run the view at the same time, and as view components are not
> > threadsafe all sorts of nasty side-effects occur. An example of a
> > non-threadsafe component is a UIData with session scope; it's got only
> > one rowIndex, so multiple threads trying to iterate over the rows in the
> > table is bound to result in something unpleasant.
> >
> > How do people handle this? I can't force my users to go on a training
> > course about waiting for a page to complete before clicking again. And I
> > can't live with exception pages being rendered to them if they click too
> > quick.
> >
> > Thanks,
> >
> > Simon
> >
>
>
> --
>
> http://www.irian.at
>
> Your JSF powerhouse -
> JSF Consulting, Development and
> Courses in English and German
>
> Professional Support for Apache MyFaces
- Antwort: Re: Handling multiple concurrent submits mathias . werlitz
- Re: Antwort: Re: Handling multiple concurrent sub... Jeremy Green
- Re: Antwort: Re: Handling multiple concurrent... Bruno Aranda
- Re: Handling multiple concurrent submits Jeremy Green
- Re: Handling multiple concurrent subm... Jeremy Green
- Re: Handling multiple concurrent... Sean Schofield
- Re: Handling multiple concur... Matt Blum
- Re: Antwort: Re: Handling multiple concurrent... Mike Kienenberger
- Antwort: Re: Handling multiple concurrent submits mathias . werlitz
- Re: Re: Handling multiple concurrent submits Mathias Brökelmann

