Deleting a project with open sessions [message #1256703] |
Tue, 25 February 2014 13:08  |
Eclipse User |
|
|
|
Hi,
I have noted that when I delete a project that contains an open session,
the session is closed _asynchronously_ via the
ResourceSyncClientNotifier Job. This has a "weird" implication:
SessionListeners cannot assume that the session resource exists when
they receive notifications from the SessionManager. This should be
documented somewhere, it's a bit unexpected.
Also, because of this, I don't think that it's actually safe to
create/open a session without synchronizing against the client notifier job:
Job.getJobManager().join(ResourceSyncClientNotifier.FAMILY)
or one risks to obtain a "corrupt" session.
But ResourceSyncClientNotifier.FAMILY is internal. Maybe it should be
made public? Or perhaps even better: Have the SessionManager join the
job internally during getSession()?
I found this while running unit tests like this:
for each stuff : stuffToTest {
Import project A
Open session A
Do stuff
Delete project A (without explicitly closing session A)
}
|
|
|
|
|
Powered by
FUDForum. Page generated in 0.03213 seconds