Skip to main content

Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Remote Application Platform (RAP) » Reload of RAP application in browser(Best way to handle/discard obsolete UISessions)
Reload of RAP application in browser [message #1775933] Wed, 08 November 2017 11:45 Go to next message
Gunnar Adams is currently offline Gunnar AdamsFriend
Messages: 29
Registered: May 2016
Junior Member

our application needs to be able to survive the user pressing the reload button or F5 in the browser.
In the design of our application we wrapped all widgets within logical components, which have methods like
createWidget(), creates the component's widget (and ancestor widgets, if required)
destroyWidget(), disposes the component's widget,
recreateWidget(), disposes and creates the component's widget.
and in addition to that methods like isWidgetAllocated (returns true, if the widget is currently assigned and false, if it isn't).

The top level component of the component tree is stored with the HttpSession and can be used to recreate the whole widget tree in case the Entrypoint is called again for the same HttpSession.
This will create a new UISession object.

We are now facing the problem, that the old UISession object, which was active before pressing "Reload" remains connected to the existing widget tree. In some (not all) cases, this leads to Server errors due to Invalid Thread access from within the old UISession. It seems to depend on timing, which is also the reason why we detected this problem at a very late stage in the development process.

What is the best way to handle the death of an old UISession due to pressing Reload in the browser? We know about UISessionListener but have not yet fully understood the exact timing when the event is sent. How does the RAP servlet detect, that the UISession is no longer valid? Will this lead to widgets "belonging to the old UISession" being disposed (notifying disposeListeners in the model)?
Unregistering the disposeListeners (and other Listeners) does not seem to be an option from within the new UISession.
Is it ok for our logical model to "forget" about all widgets and recreate them in the new UISession or will this lead to memory leaks? What kind of automatic cleanup does the UISession perform during it's destruction?
It is my understanding that the old UISession is no longer required. So we are looking for a way to severe all ties to the old UISession at the correct point in time.

Any ideas?

Thanks a lot for your input

Re: Reload of RAP application in browser [message #1775980 is a reply to message #1775933] Wed, 08 November 2017 20:01 Go to previous message
Chris Fairhall is currently offline Chris FairhallFriend
Messages: 221
Registered: February 2011
Senior Member
That's why I logged this feature request a while back
Previous Topic:Integrate Nebula Grid in RAP
Next Topic:Could not resolve module: org.eclipse.emf.parsley.rap.runtime
Goto Forum:

Current Time: Sat Oct 16 00:31:36 GMT 2021

Powered by FUDForum. Page generated in 0.01665 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top