Heartbeat while having a long-lasting request
Asked Answered
P

1

1

How can I implement a heartbeat with JSF 1.2, RichFaces 3.x using SEAM 2.x which also works during a long-lasting request executed by an user?

Currently, we've got a heartbeat (to avoid session timeout) using <aj4:poll action="#{bean.keepAlive}" ... /> which does not work during long-lasting requests on the server. Using an own eventsQueue="heartbeat" allows that the required heartbeat is sent even while executing a long-term request but leads us into a org.jboss.seam.ConcurrentRequestTimeoutException.

We also tried using @Asynchronouson the keepAlive method.

Do you have another solution or a hint to my problem? Thank you. :)


Partook answered 1/2, 2013 at 13:41 Comment(5)
Would it work if you moved the keepAlive to an separate and standalone bean? That way, it may be exempt from the Concurrency issue.Larose
No it's not working. The concurrency issue is raised by SEAM. Maybe I do have to try another ScopeType?Partook
I am not sure if it is that simple. A cleaner solution might be to get the long running process to run in the background (Asynchronously). You can then check for the completion state and the results on a regular basis until the background task completes. I think the problem you are having is that every request from that page is being tied to the same context. If you can somehow request without hitting the same context, it might work!Larose
Thank you. I've followed your suggestions but since the long-running request must have access to the current context, using Asynchronous or a thread did not work.Partook
However, we've found a solution which works for us. :)Partook
P
1

We have solved our problem running the heartbeat within a <iframe ...>. I'm actually not a friend of using frames but in this situation it's a clean quick and dirty solution.

We're still using <a4j:poll ...> within the frame.

Partook answered 6/2, 2013 at 13:49 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.