You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@myfaces.apache.org by "ir. ing. Jan Dockx" <ja...@mac.com> on 2005/10/19 12:56:03 UTC

// requests

What happens if 2 concurrent requests for the same uiview are received 
in MyFaces? Are they serialized? Is a second component tree 
instantiated? Or are there indeed concurrency problems?


Met vriendelijke groeten,

Jan Dockx

PeopleWare NV - Head Office
Cdt.Weynsstraat 85
B-2660 Hoboken
Tel: +32 3 448.33.38
Fax: +32 3 448.32.66

PeopleWare NV - Branch Office Geel
Kleinhoefstraat 5
B-2440 Geel
Tel: +32 14 57.00.90
Fax: +32 14 58.13.25

http://www.peopleware.be/
http://www.mobileware.be/

Re: // requests

Posted by Andrew robinson <an...@gmail.com>.
If you are willing to try out JBoss-Seam, you can have multiple
conversations open in a user's session, and they will not collide. So if you
want to allow users to have multiple views in the same session/browser
instance, it is possible using Seam. You don't need JBoss for Seam either, I
have had it working on tomcat.

As for the question on views, if your view's state is saved on the client,
then there is a component tree that the client stores, not the server, so
that view is never reused on the server. The view is restored from the view
that is posted back from the client to the server. With client state saving,
you will not have problems with the user posting several times in different
tabs of their browser. Note that client saving has its own limitations. For
example, I cannot have a popup dialog talk to a main page using a post back,
I'd have to do it through JavaScript. From playing around, I don't recommend
server state saving in the session as there are too many problems that can
be created by the user (back button, popup dialogs, etc.), the Seam
conversations are much more flexible for that.

-Andrew

On 10/21/05, ir. ing. Jan Dockx <ja...@mac.com> wrote:
>
> That's the saving, but that's not what I mean :-).
>
> 1) Certainly with save state = server, there is only 1 uiview tree per
> session per viewId=jsp page, right?
> 2) If so, what happens if 2 concurrent requests are executed for the
> same session/viewId? The same tree is used? (You seem to imply a
> different tree is created for each request, whose state is initialized
> to the last saved state, which triggers questions about which of the
> concurrent executions will finally save the state for the next batch).
> 3) Where is the code that handles this (if the answer to 1 and 2 is
> "no").
>
> I know there is some synchronization for this in RI somewhere (although
> I did not completely work it through).
>
>
> On 20 Oct 2005, at 13:45, Mathias Brökelmann wrote:
>
> > It´s done in the implementation of the StateManager:
> >
> > JspStateManagerImpl.saveSerializedView(...)
> > to save the component tree and the component state and
> > JspStateManagerImpl.restoreView(...)
> > to restore the component tree and the components state
> >
> > The state of the components is collected by
> > UIComponent.processSaveState() and populated by
> > UIComponent.processRestoreState() these methods traverses the
> > component tree and call StateHolder.saveState() or
> > StateHolder.restoreState() for each component.
> >
> > The StateHolder is responsible for collecting/populating the state and
> > how the state is carried between the requests. JSF defines two default
> > modes client and server side state saving. If client side is used the
> > component tree and component state is written to the response in a way
> > so that a request based on the response send this data back to the
> > server. This is normally done by hidden input fields or if javascript
> > is disabled by url params (which is limited of course).
> >
> > Server side state is simply stored in the session.
> >
> > 2005/10/20, ir. ing. Jan Dockx <ja...@mac.com>:
> >> I mean, which class, which method?
> >>
> >>
> >> On 19 Oct 2005, at 19:14, ir. ing. Jan Dockx wrote:
> >>
> >>> Some things are unclear in that respect for me. If "Each request has
> >>> its own component tree instantiated", how is view state information
> >>> carried across request/response cycles then?
> >>>
> >>> Can you point me to the code in question? It's been difficult to
> >>> find.
> >>>
> >>> On 19 Oct 2005, at 14:29, Mathias Brökelmann wrote:
> >>>
> >>>> Each request has its own component tree instantiated. So there
> >>>> should
> >>>> no problem with concurrency. If you use session or application
> >>>> scoped
> >>>> beans then you have to care for concurrency of course.
> >>>>
> >>>> 2005/10/19, ir. ing. Jan Dockx <ja...@mac.com>:
> >>>>> What happens if 2 concurrent requests for the same uiview are
> >>>>> received
> >>>>> in MyFaces? Are they serialized? Is a second component tree
> >>>>> instantiated? Or are there indeed concurrency problems?
> >>>>>
> >>>>>
> >>>>> Met vriendelijke groeten,
> >>>>>
> >>>>> Jan Dockx
> >>>>>
> >>>>> PeopleWare NV - Head Office
> >>>>> Cdt.Weynsstraat 85
> >>>>> B-2660 Hoboken
> >>>>> Tel: +32 3 448.33.38
> >>>>> Fax: +32 3 448.32.66
> >>>>>
> >>>>> PeopleWare NV - Branch Office Geel
> >>>>> Kleinhoefstraat 5
> >>>>> B-2440 Geel
> >>>>> Tel: +32 14 57.00.90
> >>>>> Fax: +32 14 58.13.25
> >>>>>
> >>>>> http://www.peopleware.be/
> >>>>> http://www.mobileware.be/
> >>>>>
> >>>>>
> >>>>
> >>>>
> >>>> --
> >>>> Mathias
> >>>>
> >>>>
> >>> Met vriendelijke groeten,
> >>>
> >>> Jan Dockx
> >>>
> >>> PeopleWare NV - Head Office
> >>> Cdt.Weynsstraat 85
> >>> B-2660 Hoboken
> >>> Tel: +32 3 448.33.38
> >>> Fax: +32 3 448.32.66
> >>>
> >>> PeopleWare NV - Branch Office Geel
> >>> Kleinhoefstraat 5
> >>> B-2440 Geel
> >>> Tel: +32 14 57.00.90
> >>> Fax: +32 14 58.13.25
> >>>
> >>> http://www.peopleware.be/
> >>> http://www.mobileware.be/
> >>>
> >> Met vriendelijke groeten,
> >>
> >> Jan Dockx
> >>
> >> PeopleWare NV - Head Office
> >> Cdt.Weynsstraat 85
> >> B-2660 Hoboken
> >> Tel: +32 3 448.33.38
> >> Fax: +32 3 448.32.66
> >>
> >> PeopleWare NV - Branch Office Geel
> >> Kleinhoefstraat 5
> >> B-2440 Geel
> >> Tel: +32 14 57.00.90
> >> Fax: +32 14 58.13.25
> >>
> >> http://www.peopleware.be/
> >> http://www.mobileware.be/
> >>
> >>
> >>
> >
> >
> > --
> > Mathias
> >
> >
> Met vriendelijke groeten,
>
> Jan Dockx
>
> PeopleWare NV - Head Office
> Cdt.Weynsstraat 85
> B-2660 Hoboken
> Tel: +32 3 448.33.38
> Fax: +32 3 448.32.66
>
> PeopleWare NV - Branch Office Geel
> Kleinhoefstraat 5
> B-2440 Geel
> Tel: +32 14 57.00.90
> Fax: +32 14 58.13.25
>
> http://www.peopleware.be/
> http://www.mobileware.be/
>
>
>

Re: // requests

Posted by "ir. ing. Jan Dockx" <ja...@mac.com>.
That's the saving, but that's not what I mean :-).

1) Certainly with save state = server, there is only 1 uiview tree per 
session per viewId=jsp page, right?
2) If so, what happens if 2 concurrent requests are executed for the 
same session/viewId? The same tree is used? (You seem to imply a 
different tree is created for each request, whose state is initialized 
to the last saved state, which triggers questions about which of the 
concurrent executions will finally save the state for the next batch).
3) Where is the code that handles this (if the answer to 1 and 2 is 
"no").

I know there is some synchronization for this in RI somewhere (although 
I did not completely work it through).


On 20 Oct 2005, at 13:45, Mathias Brökelmann wrote:

> It´s done in the implementation of the StateManager:
>
> JspStateManagerImpl.saveSerializedView(...)
> to save the component tree and the component state and
> JspStateManagerImpl.restoreView(...)
> to restore the component tree and the components state
>
> The state of the components is collected by
> UIComponent.processSaveState() and populated by
> UIComponent.processRestoreState() these methods traverses the
> component tree and call StateHolder.saveState() or
> StateHolder.restoreState() for each component.
>
> The StateHolder is responsible for collecting/populating the state and
> how the state is carried between the requests. JSF defines two default
> modes client and server side state saving. If client side is used the
> component tree and component state is written to the response in a way
> so that a request based on the response send this data back to the
> server. This is normally done by hidden input fields or if javascript
> is disabled by url params (which is limited of course).
>
> Server side state is simply stored in the session.
>
> 2005/10/20, ir. ing. Jan Dockx <ja...@mac.com>:
>> I mean, which class, which method?
>>
>>
>> On 19 Oct 2005, at 19:14, ir. ing. Jan Dockx wrote:
>>
>>> Some things are unclear in that respect for me. If "Each request has
>>> its own component tree instantiated", how is view state information
>>> carried across request/response cycles then?
>>>
>>> Can you point me to the code in question? It's been difficult to 
>>> find.
>>>
>>> On 19 Oct 2005, at 14:29, Mathias Brökelmann wrote:
>>>
>>>> Each request has its own component tree instantiated. So there 
>>>> should
>>>> no problem with concurrency. If you use session or application 
>>>> scoped
>>>> beans then you have to care for concurrency of course.
>>>>
>>>> 2005/10/19, ir. ing. Jan Dockx <ja...@mac.com>:
>>>>> What happens if 2 concurrent requests for the same uiview are
>>>>> received
>>>>> in MyFaces? Are they serialized? Is a second component tree
>>>>> instantiated? Or are there indeed concurrency problems?
>>>>>
>>>>>
>>>>> Met vriendelijke groeten,
>>>>>
>>>>> Jan Dockx
>>>>>
>>>>> PeopleWare NV - Head Office
>>>>> Cdt.Weynsstraat 85
>>>>> B-2660 Hoboken
>>>>> Tel: +32 3 448.33.38
>>>>> Fax: +32 3 448.32.66
>>>>>
>>>>> PeopleWare NV - Branch Office Geel
>>>>> Kleinhoefstraat 5
>>>>> B-2440 Geel
>>>>> Tel: +32 14 57.00.90
>>>>> Fax: +32 14 58.13.25
>>>>>
>>>>> http://www.peopleware.be/
>>>>> http://www.mobileware.be/
>>>>>
>>>>>
>>>>
>>>>
>>>> --
>>>> Mathias
>>>>
>>>>
>>> Met vriendelijke groeten,
>>>
>>> Jan Dockx
>>>
>>> PeopleWare NV - Head Office
>>> Cdt.Weynsstraat 85
>>> B-2660 Hoboken
>>> Tel: +32 3 448.33.38
>>> Fax: +32 3 448.32.66
>>>
>>> PeopleWare NV - Branch Office Geel
>>> Kleinhoefstraat 5
>>> B-2440 Geel
>>> Tel: +32 14 57.00.90
>>> Fax: +32 14 58.13.25
>>>
>>> http://www.peopleware.be/
>>> http://www.mobileware.be/
>>>
>> Met vriendelijke groeten,
>>
>> Jan Dockx
>>
>> PeopleWare NV - Head Office
>> Cdt.Weynsstraat 85
>> B-2660 Hoboken
>> Tel: +32 3 448.33.38
>> Fax: +32 3 448.32.66
>>
>> PeopleWare NV - Branch Office Geel
>> Kleinhoefstraat 5
>> B-2440 Geel
>> Tel: +32 14 57.00.90
>> Fax: +32 14 58.13.25
>>
>> http://www.peopleware.be/
>> http://www.mobileware.be/
>>
>>
>>
>
>
> --
> Mathias
>
>
Met vriendelijke groeten,

Jan Dockx

PeopleWare NV - Head Office
Cdt.Weynsstraat 85
B-2660 Hoboken
Tel: +32 3 448.33.38
Fax: +32 3 448.32.66

PeopleWare NV - Branch Office Geel
Kleinhoefstraat 5
B-2440 Geel
Tel: +32 14 57.00.90
Fax: +32 14 58.13.25

http://www.peopleware.be/
http://www.mobileware.be/

Re: // requests

Posted by Matthias Wessendorf <mw...@gmail.com>.
> server. This is normally done by hidden input fields or if javascript
> is disabled by url params (which is limited of course).

in JSF 1.2 the parameter for state saving is specified. Currently
each implementation is doing it their "own" way.

-Matthias


>
> Server side state is simply stored in the session.
>
> 2005/10/20, ir. ing. Jan Dockx <ja...@mac.com>:
> > I mean, which class, which method?
> >
> >
> > On 19 Oct 2005, at 19:14, ir. ing. Jan Dockx wrote:
> >
> > > Some things are unclear in that respect for me. If "Each request has
> > > its own component tree instantiated", how is view state information
> > > carried across request/response cycles then?
> > >
> > > Can you point me to the code in question? It's been difficult to find.
> > >
> > > On 19 Oct 2005, at 14:29, Mathias Brökelmann wrote:
> > >
> > >> Each request has its own component tree instantiated. So there should
> > >> no problem with concurrency. If you use session or application scoped
> > >> beans then you have to care for concurrency of course.
> > >>
> > >> 2005/10/19, ir. ing. Jan Dockx <ja...@mac.com>:
> > >>> What happens if 2 concurrent requests for the same uiview are
> > >>> received
> > >>> in MyFaces? Are they serialized? Is a second component tree
> > >>> instantiated? Or are there indeed concurrency problems?
> > >>>
> > >>>
> > >>> Met vriendelijke groeten,
> > >>>
> > >>> Jan Dockx
> > >>>
> > >>> PeopleWare NV - Head Office
> > >>> Cdt.Weynsstraat 85
> > >>> B-2660 Hoboken
> > >>> Tel: +32 3 448.33.38
> > >>> Fax: +32 3 448.32.66
> > >>>
> > >>> PeopleWare NV - Branch Office Geel
> > >>> Kleinhoefstraat 5
> > >>> B-2440 Geel
> > >>> Tel: +32 14 57.00.90
> > >>> Fax: +32 14 58.13.25
> > >>>
> > >>> http://www.peopleware.be/
> > >>> http://www.mobileware.be/
> > >>>
> > >>>
> > >>
> > >>
> > >> --
> > >> Mathias
> > >>
> > >>
> > > Met vriendelijke groeten,
> > >
> > > Jan Dockx
> > >
> > > PeopleWare NV - Head Office
> > > Cdt.Weynsstraat 85
> > > B-2660 Hoboken
> > > Tel: +32 3 448.33.38
> > > Fax: +32 3 448.32.66
> > >
> > > PeopleWare NV - Branch Office Geel
> > > Kleinhoefstraat 5
> > > B-2440 Geel
> > > Tel: +32 14 57.00.90
> > > Fax: +32 14 58.13.25
> > >
> > > http://www.peopleware.be/
> > > http://www.mobileware.be/
> > >
> > Met vriendelijke groeten,
> >
> > Jan Dockx
> >
> > PeopleWare NV - Head Office
> > Cdt.Weynsstraat 85
> > B-2660 Hoboken
> > Tel: +32 3 448.33.38
> > Fax: +32 3 448.32.66
> >
> > PeopleWare NV - Branch Office Geel
> > Kleinhoefstraat 5
> > B-2440 Geel
> > Tel: +32 14 57.00.90
> > Fax: +32 14 58.13.25
> >
> > http://www.peopleware.be/
> > http://www.mobileware.be/
> >
> >
> >
>
>
> --
> Mathias
>


--
Matthias Wessendorf
Zülpicher Wall 12, 239
50674 Köln
http://www.wessendorf.net
mwessendorf-at-gmail-dot-com

Re: // requests

Posted by Mathias Brökelmann <mb...@googlemail.com>.
It´s done in the implementation of the StateManager:

JspStateManagerImpl.saveSerializedView(...)
to save the component tree and the component state and
JspStateManagerImpl.restoreView(...)
to restore the component tree and the components state

The state of the components is collected by
UIComponent.processSaveState() and populated by
UIComponent.processRestoreState() these methods traverses the
component tree and call StateHolder.saveState() or
StateHolder.restoreState() for each component.

The StateHolder is responsible for collecting/populating the state and
how the state is carried between the requests. JSF defines two default
modes client and server side state saving. If client side is used the
component tree and component state is written to the response in a way
so that a request based on the response send this data back to the
server. This is normally done by hidden input fields or if javascript
is disabled by url params (which is limited of course).

Server side state is simply stored in the session.

2005/10/20, ir. ing. Jan Dockx <ja...@mac.com>:
> I mean, which class, which method?
>
>
> On 19 Oct 2005, at 19:14, ir. ing. Jan Dockx wrote:
>
> > Some things are unclear in that respect for me. If "Each request has
> > its own component tree instantiated", how is view state information
> > carried across request/response cycles then?
> >
> > Can you point me to the code in question? It's been difficult to find.
> >
> > On 19 Oct 2005, at 14:29, Mathias Brökelmann wrote:
> >
> >> Each request has its own component tree instantiated. So there should
> >> no problem with concurrency. If you use session or application scoped
> >> beans then you have to care for concurrency of course.
> >>
> >> 2005/10/19, ir. ing. Jan Dockx <ja...@mac.com>:
> >>> What happens if 2 concurrent requests for the same uiview are
> >>> received
> >>> in MyFaces? Are they serialized? Is a second component tree
> >>> instantiated? Or are there indeed concurrency problems?
> >>>
> >>>
> >>> Met vriendelijke groeten,
> >>>
> >>> Jan Dockx
> >>>
> >>> PeopleWare NV - Head Office
> >>> Cdt.Weynsstraat 85
> >>> B-2660 Hoboken
> >>> Tel: +32 3 448.33.38
> >>> Fax: +32 3 448.32.66
> >>>
> >>> PeopleWare NV - Branch Office Geel
> >>> Kleinhoefstraat 5
> >>> B-2440 Geel
> >>> Tel: +32 14 57.00.90
> >>> Fax: +32 14 58.13.25
> >>>
> >>> http://www.peopleware.be/
> >>> http://www.mobileware.be/
> >>>
> >>>
> >>
> >>
> >> --
> >> Mathias
> >>
> >>
> > Met vriendelijke groeten,
> >
> > Jan Dockx
> >
> > PeopleWare NV - Head Office
> > Cdt.Weynsstraat 85
> > B-2660 Hoboken
> > Tel: +32 3 448.33.38
> > Fax: +32 3 448.32.66
> >
> > PeopleWare NV - Branch Office Geel
> > Kleinhoefstraat 5
> > B-2440 Geel
> > Tel: +32 14 57.00.90
> > Fax: +32 14 58.13.25
> >
> > http://www.peopleware.be/
> > http://www.mobileware.be/
> >
> Met vriendelijke groeten,
>
> Jan Dockx
>
> PeopleWare NV - Head Office
> Cdt.Weynsstraat 85
> B-2660 Hoboken
> Tel: +32 3 448.33.38
> Fax: +32 3 448.32.66
>
> PeopleWare NV - Branch Office Geel
> Kleinhoefstraat 5
> B-2440 Geel
> Tel: +32 14 57.00.90
> Fax: +32 14 58.13.25
>
> http://www.peopleware.be/
> http://www.mobileware.be/
>
>
>


--
Mathias

Re: // requests

Posted by "ir. ing. Jan Dockx" <ja...@mac.com>.
I mean, which class, which method?


On 19 Oct 2005, at 19:14, ir. ing. Jan Dockx wrote:

> Some things are unclear in that respect for me. If "Each request has 
> its own component tree instantiated", how is view state information 
> carried across request/response cycles then?
>
> Can you point me to the code in question? It's been difficult to find.
>
> On 19 Oct 2005, at 14:29, Mathias Brökelmann wrote:
>
>> Each request has its own component tree instantiated. So there should
>> no problem with concurrency. If you use session or application scoped
>> beans then you have to care for concurrency of course.
>>
>> 2005/10/19, ir. ing. Jan Dockx <ja...@mac.com>:
>>> What happens if 2 concurrent requests for the same uiview are 
>>> received
>>> in MyFaces? Are they serialized? Is a second component tree
>>> instantiated? Or are there indeed concurrency problems?
>>>
>>>
>>> Met vriendelijke groeten,
>>>
>>> Jan Dockx
>>>
>>> PeopleWare NV - Head Office
>>> Cdt.Weynsstraat 85
>>> B-2660 Hoboken
>>> Tel: +32 3 448.33.38
>>> Fax: +32 3 448.32.66
>>>
>>> PeopleWare NV - Branch Office Geel
>>> Kleinhoefstraat 5
>>> B-2440 Geel
>>> Tel: +32 14 57.00.90
>>> Fax: +32 14 58.13.25
>>>
>>> http://www.peopleware.be/
>>> http://www.mobileware.be/
>>>
>>>
>>
>>
>> --
>> Mathias
>>
>>
> Met vriendelijke groeten,
>
> Jan Dockx
>
> PeopleWare NV - Head Office
> Cdt.Weynsstraat 85
> B-2660 Hoboken
> Tel: +32 3 448.33.38
> Fax: +32 3 448.32.66
>
> PeopleWare NV - Branch Office Geel
> Kleinhoefstraat 5
> B-2440 Geel
> Tel: +32 14 57.00.90
> Fax: +32 14 58.13.25
>
> http://www.peopleware.be/
> http://www.mobileware.be/
>
Met vriendelijke groeten,

Jan Dockx

PeopleWare NV - Head Office
Cdt.Weynsstraat 85
B-2660 Hoboken
Tel: +32 3 448.33.38
Fax: +32 3 448.32.66

PeopleWare NV - Branch Office Geel
Kleinhoefstraat 5
B-2440 Geel
Tel: +32 14 57.00.90
Fax: +32 14 58.13.25

http://www.peopleware.be/
http://www.mobileware.be/

Re: // requests

Posted by "ir. ing. Jan Dockx" <ja...@mac.com>.
Some things are unclear in that respect for me. If "Each request has 
its own component tree instantiated", how is view state information 
carried across request/response cycles then?

Can you point me to the code in question? It's been difficult to find.

On 19 Oct 2005, at 14:29, Mathias Brökelmann wrote:

> Each request has its own component tree instantiated. So there should
> no problem with concurrency. If you use session or application scoped
> beans then you have to care for concurrency of course.
>
> 2005/10/19, ir. ing. Jan Dockx <ja...@mac.com>:
>> What happens if 2 concurrent requests for the same uiview are received
>> in MyFaces? Are they serialized? Is a second component tree
>> instantiated? Or are there indeed concurrency problems?
>>
>>
>> Met vriendelijke groeten,
>>
>> Jan Dockx
>>
>> PeopleWare NV - Head Office
>> Cdt.Weynsstraat 85
>> B-2660 Hoboken
>> Tel: +32 3 448.33.38
>> Fax: +32 3 448.32.66
>>
>> PeopleWare NV - Branch Office Geel
>> Kleinhoefstraat 5
>> B-2440 Geel
>> Tel: +32 14 57.00.90
>> Fax: +32 14 58.13.25
>>
>> http://www.peopleware.be/
>> http://www.mobileware.be/
>>
>>
>
>
> --
> Mathias
>
>
Met vriendelijke groeten,

Jan Dockx

PeopleWare NV - Head Office
Cdt.Weynsstraat 85
B-2660 Hoboken
Tel: +32 3 448.33.38
Fax: +32 3 448.32.66

PeopleWare NV - Branch Office Geel
Kleinhoefstraat 5
B-2440 Geel
Tel: +32 14 57.00.90
Fax: +32 14 58.13.25

http://www.peopleware.be/
http://www.mobileware.be/

Re: // requests

Posted by Mathias Brökelmann <mb...@googlemail.com>.
Each request has its own component tree instantiated. So there should
no problem with concurrency. If you use session or application scoped
beans then you have to care for concurrency of course.

2005/10/19, ir. ing. Jan Dockx <ja...@mac.com>:
> What happens if 2 concurrent requests for the same uiview are received
> in MyFaces? Are they serialized? Is a second component tree
> instantiated? Or are there indeed concurrency problems?
>
>
> Met vriendelijke groeten,
>
> Jan Dockx
>
> PeopleWare NV - Head Office
> Cdt.Weynsstraat 85
> B-2660 Hoboken
> Tel: +32 3 448.33.38
> Fax: +32 3 448.32.66
>
> PeopleWare NV - Branch Office Geel
> Kleinhoefstraat 5
> B-2440 Geel
> Tel: +32 14 57.00.90
> Fax: +32 14 58.13.25
>
> http://www.peopleware.be/
> http://www.mobileware.be/
>
>


--
Mathias

Re: // requests

Posted by Mario Ivankovits <ma...@ops.co.at>.
Mike Kienenberger wrote:
>I'm wondering if the best solution might not be to simply have a
>servlet filter that only allowed one request per session to occur at
>any one time.
(If you are tired reading all this stuff, go ahead to ====>)

This filter is a good start. We already used such a stuff (its really 
easy to implement) and - as long as your business classes wont introduce 
a too high latency (or even lock) - it works pretty well.
The only drawback with such a filter is, you serialze every request, 
even if they do not have concurrency issues. On pages where you have 
multiple dynamically generated images (or iframes .... ok,ok no flames, 
I know they are bad ;-) ) you see a performance impact.

Thoug, there is still another drawback of the "double requests" issue 
and such a solution:
Even with your filter, the user might only see the last requested page, 
all request outputs before are lost - sure, not that a high problem, but 
still not that nice.

There are (at least) two issues why double requests happens:
1) The user press a button/link too fast in serie
2) The business logic needs too much time to present a result, and thus 
no page transition has been done

The first point is a problem - might be solveable by some javascript 
which disables the button/link after the first press. But you have to 
think about reenabling it if some client-side validation fails - this 
might be a challenge to solve. Also its hard to reenable if your 
link/butotn opens a popup.
At least I think this is something a user will learn pretty fast, even 
more if we find a solution for 2:

====> And now I'll come to the main request: The second point could be 
solved using push technology (or mutlipart response) (where possible). 
So if we force a page transition as fast as possible the user might have 
no chance to press the button/link again, only one request and the 
correct (first requested) output.

We should have immediate page transition and could have a small 
javascript in the first response which will print a text like "Your 
request will be processed ..." after 2 seconds.

I havent had the time for now to look into such a stuff, but this should 
be possible to do, not?

Two questions with this solution:
*) Is it possible to render the first part of the respons using content 
type "text/html" but the second part as "application/pdf" ?
*) If - not: We have to find a way to disable the filter, at least by 
using some url patterns in web.xml.

Comments?
---
Mario


Re: // requests

Posted by Mike Kienenberger <mk...@gmail.com>.
I've been concerned about concurrent same-session requests for awhile now.
I'm wondering if the best solution might not be to simply have a
servlet filter that only allowed one request per session to occur at
any one time.    That's the approach I'm going to try.   That solves
the issue not only for JSF but for anything else at the same time.

On 10/19/05, ir. ing. Jan Dockx <ja...@mac.com> wrote:
> What happens if 2 concurrent requests for the same uiview are received
> in MyFaces? Are they serialized? Is a second component tree
> instantiated? Or are there indeed concurrency problems?
>
>
> Met vriendelijke groeten,
>
> Jan Dockx
>
> PeopleWare NV - Head Office
> Cdt.Weynsstraat 85
> B-2660 Hoboken
> Tel: +32 3 448.33.38
> Fax: +32 3 448.32.66
>
> PeopleWare NV - Branch Office Geel
> Kleinhoefstraat 5
> B-2440 Geel
> Tel: +32 14 57.00.90
> Fax: +32 14 58.13.25
>
> http://www.peopleware.be/
> http://www.mobileware.be/
>
>