Ajax call is blocking the entire UI

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

Ajax call is blocking the entire UI

mr nobody
This post was updated on .
HI all,
 
I have created a component that is used to load a badge count. I am
updating this component every 5 seconds, however the processing for some
environment takes longer due amount of data. There fore, the ajax call
request done in this component was just blocked the entire UI avoiding any
other request while the ajax call is not returned. I solved that problem
by creating a thread to run my background process, and immediately return the
request, next time a new request is done I check if the work by thread is
done and update my UI. Nevertheless, I am still wondering why an ajax
request that is supposed to be asynchronous is blocked the other requests.

Regards,
Rob
Reply | Threaded
Open this post in threaded view
|

Re: Ajax call is blocking the entire UI

Cezary Biernacki
By default Tapestry locks user session when handling requests
(see org.apache.tapestry5.internal.services.TapestrySessionFactoryImpl#getSession).
It makes your applications less susceptible to race conditions but of
course it has drawback that only one request per user (if a session is
used) can be handled concurrently.

You can disable this behaviour by setting symbol
"tapestry.session-locking-enabled" to false,
see org.apache.tapestry5.SymbolConstants#SESSION_LOCKING_ENABLED.

On Tue, Jun 26, 2018 at 5:30 PM Robson Liebke <[hidden email]>
wrote:

> HI all,
>
> I have created a component that is used to load a badge count. I am
> updating this component every 5 seconds, however the processing for some
> environment takes longer due amount of data. There fore, the ajax call
> request done in this component was just blocked the entire UI avoiding any
> other request while the ajax call is not returned. I solved that problem by
> creating a thread to run my background process, and immediately return the
> request, next time a new request is done I check if the work by thread is
> done and update my UI. Nevertheless, I am still wondering why an ajax
> request that is supposed to be asynchronous is blocked the other requests.
>
> Regards,
> Rob
>
Reply | Threaded
Open this post in threaded view
|

Re: Ajax call is blocking the entire UI

Cezary Biernacki
See also documentation:
http://tapestry.apache.org/session-storage.html#SessionStorage-SessionLocking

On Tue, Jun 26, 2018 at 5:40 PM Cezary Biernacki <[hidden email]>
wrote:

> By default Tapestry locks user session when handling requests
> (see org.apache.tapestry5.internal.services.TapestrySessionFactoryImpl#getSession).
> It makes your applications less susceptible to race conditions but of
> course it has drawback that only one request per user (if a session is
> used) can be handled concurrently.
>
> You can disable this behaviour by setting symbol
> "tapestry.session-locking-enabled" to false,
> see org.apache.tapestry5.SymbolConstants#SESSION_LOCKING_ENABLED.
>
> On Tue, Jun 26, 2018 at 5:30 PM Robson Liebke <[hidden email]>
> wrote:
>
>> HI all,
>>
>> I have created a component that is used to load a badge count. I am
>> updating this component every 5 seconds, however the processing for some
>> environment takes longer due amount of data. There fore, the ajax call
>> request done in this component was just blocked the entire UI avoiding any
>> other request while the ajax call is not returned. I solved that problem
>> by
>> creating a thread to run my background process, and immediately return the
>> request, next time a new request is done I check if the work by thread is
>> done and update my UI. Nevertheless, I am still wondering why an ajax
>> request that is supposed to be asynchronous is blocked the other requests.
>>
>> Regards,
>> Rob
>>
>