How do I handle timing out the session while using an ajax polling mechanism?

Solution Unverified - Updated -

Issue

  • Is there a good example on how to handle session timeouts when ajax is running requests on a timer in your screens?  We currently have a number of screens that have timer count queries running every minute (a4j:poll).  However, because of this, the user's session never times out.   

Let's say we have a poll which is refreshing a panel every 30 seconds.
Every 30 seconds it will execute an action before refreshing the panel.

Let's say due to some reason action always provide response after 45 seconds only.
So when poll starts the second refresh, response from first cycle is not received yet.

What I want to do is ignore this second refresh and don't execute the action in second cycle as response from first cycle action is not received yet.

Poll has to execute the action in third cycle as by that time response from first cycle would be received.

  • For the a4j:poll component, how can we not fire the action if previous action didn't receive response yet?

Environment

  • JBoss Enterprise Application Platform (EAP)
    • 4.x
    • 5.x
    • 6.x
  • Red Hat JBoss Web Framework (WFK)
    • 2.x

Subscriber exclusive content

A Red Hat subscription provides unlimited access to our knowledgebase of over 48,000 articles and solutions.

Current Customers and Partners

Log in for full access

Log In
Close

Welcome! Check out the Getting Started with Red Hat page for quick tours and guides for common tasks.