This content has been marked as final. Show 5 replies
Ok, I managed to stop the session from expiring by sending ajax requests to the server every 30 seconds, but I don't believe this should be necassary. I'm sure that Flex should have a build in solution for this kind of thing.
Any help on this issue wold be very much appreciated.
Flex is a stateful, client side, presentation technology. There is no required communication with a server at all. Sessions are to support stateless HTML pages. So there is no built-in Flex-Server session functionality.
"pinging" the server is a common task.
What do you want to happen when a server-side session times out?
Thanks for the info about how Flex works, and the suggestion about pinging the server. My problem is that on the server I have remote object with application scope, which uses a JPA (Toplink) entity manager. This works fine as long as the session is active, but when the session expires the entity manger returns inaccurate results, and doesn't save properly. Do you think this is related to the session expiry, or am I simply overlooking something more trivial.
I do not know those server technologies so I can't suggest anything specific, but I would think that this issue should be handled server-side.
Yeah it turned out to be a server-side issue, not a flex one. I had bound my EntityManager instance to ThreadLocal meaning that it was effectively invisible to other threads. I think what happened was that when the session times out, the associated thread resources are released and garbage collected, and that's why things started going weird. But thanks for your help, and maybe this can help someone who has similar problems in the future.