This post was updated on .
Hi group,
We are investigating if we can get rid of this error. Orbeon has some nice features to keep sessions alive (heartbeat) and to remember the forms state (ehcache), but still, we are getting an error dialog in the following case - Open a form - Make some changes to the form controls (e.g. type some text in an input field) - Wait for at least 30 minutes (the default time to idle of the xforms.state ehcache) - Choose "back" from your browser's history We are using Orbeon version 4.4.1, but I also tested with 4.8.0 (you then need to wait for at least 5 hours, because the ehcache config was changed). You can specify on your xforms model that you don't want to try and restore the forms state, but instead reload the page (as if you haven't visited the page before): <xf:model xxf:revisit-handling="reload"> We could specify this on all our pages, but it looks better to try and restore the state if possible (better user experience). As you can't cache all form states forever, and we don't want to annoy the user with this error dialog, I guess what I'm trying to achieve now, is to restore the form state if possible, but reload the page if the state was already purged from the cache. I found this can be achieved by disabling the error dialog: <property as="xs:boolean" name="oxf.xforms.show-error-dialog" value="false"/> and registering your own listener ORBEON.xforms.Events.errorEvent.subscribe(function(eventName, eventData) { location.reload(); }); But I'm afraid that other errors are no longer reported (and there probably are some errors for which the solution is something else than reloading the page). An extra complexity is that we don't have control of all the orbeon apps, so we can't make sure that everybody registers this listener. Is there a way to achieve this, or do you have any other suggestions? Thanks in advance, Tars Joris Development Manager www.inventivedesigners.com |
Administrator
|
Hi Tars,
You should make sure that the Ehcache timeToIdleSeconds (in ehcache.xml) is significantly larger than the session timeout (session-timeout in web.xml). In 4.8, we set those to 5 hours and 30 minutes by default. With those settings, you shouldn't get an "Unable to retrieve XForms engine state" error, as before the session expires (say 25 min in), thanks to the keep alive feature, the browser will send an Ajax request to the server, which will take the state out of Ehcache. But before 4.8, the settings were "wrong", and that error could have happened. But if for some reason you can replicate that error with 4.8, please let us know what the use case is. (Obviously, we don't want those errors to happen; they would render all the work done on the keep alive, and persisting state to disk useless!) Alex
--
Follow Orbeon on Twitter: @orbeon Follow me on Twitter: @avernet |
Hi Alex,
Thanks for your response. I just did a test with Orbeon 4.8 (30 minute session timeout and 5 hour ehcache timeout) and could reproduce the error by doing the following: - Open a form (say A) - Navigate to another form (say B). Now the state of form A is in the ehcache cache and will be kept for 5 hours - Wait for more than 5 hours (luckily it's weekend, so I was able to do something else and actually test this without changing any settings) - The session is kept alive, as well as the state of form B, but the state of form A is not touched and expires - Navigate back to the previous page (with the browser's history functionality) => You are now back on form A, but the state of form A has timed out and was purged from the ehcache. You get the error dialog. Although the behavior is already a lot better when the ehcache's expiration time is 5 hours instead of 30 minutes, the user can still be confronted with this error dialog while he didn't do anything wrong and there were no bugs in the orbeon app or in the web services. I guess we are fine with form A being reset in this case (since you can't cache everything forever), but without a dialog that makes no sense to the user. In most cases, the solution is reloading the page anyway, and the user probably didn't loose any important data. What are your thoughts on this? Do you have any suggestions? As I said, disabling the error dialog entirely looks dangerous. Kind regards, Tars |
Administrator
|
Hi Tars,
Yes, we are aware of this issue. You can make the Ehcache "time to idle" even longer to make the issue even less likely to happen. The longer you set it, the less likely the issue it to happen, and hopefully you can make it long enough that the likelihood is so small that you can be comfortable with it. And having a very long time to idle usually isn't a problem, as it will just use disk space, which is generally cheap. But granted, this doesn't truly fix the problem. We have an issue open to implement a real fix, and would like to have this done for 4.9: https://github.com/orbeon/orbeon-forms/issues/2013 Alex
--
Follow Orbeon on Twitter: @orbeon Follow me on Twitter: @avernet |
Hi Alex,
That's great. We'll go with that for now, and keep an eye on the github issue. Thanks for your help, Tars |
Free forum by Nabble | Edit this page |