Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 344564 - Replace lazy initialization in ContextProvider#getSession()
Summary: Replace lazy initialization in ContextProvider#getSession()
Status: RESOLVED FIXED
Alias: None
Product: RAP
Classification: RT
Component: RWT (show other bugs)
Version: 1.4   Edit
Hardware: PC Linux
: P3 enhancement (vote)
Target Milestone: 2.1   Edit
Assignee: Project Inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords:
: 393552 (view as bug list)
Depends on:
Blocks:
 
Reported: 2011-05-03 08:54 EDT by Ralf Sternberg CLA
Modified: 2013-06-06 09:49 EDT (History)
1 user (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Ralf Sternberg CLA 2011-05-03 08:54:18 EDT
Since ContextProvider#getSession() can be called by different threads, the unsynchronized lazy initialization pattern is dangerous at this place. This doesn't seem to be an issue at runtime, as the session is only initialized by RWTDelegate#createSessionStore().

However, instead of initializing the session lazily, we should introduce a dedicated init method that is called by RWTDelegate#createSessionStore().
Comment 1 Rüdiger Herrmann CLA 2011-05-18 08:24:47 EDT
LifeCycleServiceHandler#clearSessionStore() also (re-)initializes the session. Pleas take this into account when adressing this issue.
Comment 2 Ralf Sternberg CLA 2013-06-06 09:47:47 EDT
As of 2.1, the UISession (formerly SessionStore) is created and initialized in the RWTServlet at startup. In case of a session restart, a new UISession is created in LifeCycleServiceHandler.

There is no lazy initialization anymore.
Comment 3 Ralf Sternberg CLA 2013-06-06 09:49:23 EDT
*** Bug 393552 has been marked as a duplicate of this bug. ***