Bug 200735 - [Persistence][api] Delete a profile that contains a connection and restart, profile is back without connections
Summary: [Persistence][api] Delete a profile that contains a connection and restart, p...
Status: CLOSED FIXED
Alias: None
Product: Target Management
Classification: Tools
Component: RSE (show other bugs)
Version: 2.0   Edit
Hardware: PC Windows XP
: P3 normal (vote)
Target Milestone: 3.0 M6   Edit
Assignee: David Dykstal CLA
QA Contact: Martin Oberhuber CLA
URL:
Whiteboard:
Keywords: api
Depends on:
Blocks:
 
Reported: 2007-08-21 17:30 EDT by Kevin Doyle CLA
Modified: 2012-05-23 16:46 EDT (History)
2 users (show)

See Also:
kjdoyle: review? (ddykstal.eclipse)


Attachments
Adds a Quiesce state to System Profiles (7.37 KB, patch)
2007-09-13 16:46 EDT, Kevin Doyle CLA
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Kevin Doyle CLA 2007-08-21 17:30:29 EDT
Create a profile and a connection for that profile.  Delete the profile.  The profile is deleted, but 1 second later it is recreated without the connections.  If you restart the profile is back without the connections.

Steps to Reproduce:
1. Create a new profile.
2. Create a connection for that profile.
3. Delete the profile.
--> If you are watching .metadata\.plugins\org.eclipse.rse.core\profiles you will see it is removed.  Wait a second and it is back, without the connection.
4. Restart.
--> Profile is back without the connection

-----------Enter bugs above this line-----------
TM 2.0.1 Testing
installation : eclipse-SDK-3.3
RSE install  : Dev Driver - 
java.runtime : Sun 1.5.0_11-b03
os.name:     : Windows XP, Service Pack 2
------------------------------------------------
Comment 1 Kevin Doyle CLA 2007-08-23 15:59:45 EDT
This is happening because in SystemRegistry.deleteSystemProfile(ISystemProfile) we are calling SystemRegistry.deleteHost(IHost) for each connection in the profile.  SystemRegistry.deleteHost(IHost) calls SystemHostPool.deleteHost(IHost) which calls a commit on the profile, so a job is scheduled for the save.  A little farther down in SystemRegistry.deleteSystemProfile(ISystemProfile) we call getSystemProfileManager().deleteSystemProfile(profile, true); which schedules a delete job.  

I put a breakpoint in the 2 jobs and the Delete job is run first and then the commit job.  That is why the profile is deleted and then comes back.
Comment 2 Kevin Doyle CLA 2007-09-13 16:46:55 EDT
Created attachment 78383 [details]
Adds a Quiesce state to System Profiles

Legal Message: I, Kevin Doyle, declare that I developed attached code from
scratch, without referencing any 3rd party materials except material licensed
under the EPL. I am authorized by my employer, IBM Canada Ltd. to make this
contribution under the EPL.
Comment 3 David Dykstal CLA 2008-04-06 15:59:56 EDT
Added API to suspend and resume profiles (same as the quiesce concept talked about above)

ISystemProfile
@noimplement
public void suspend()
public void resume()
public boolean isSuspended();

Comment 4 Kevin Doyle CLA 2008-05-30 16:32:58 EDT
Verified Fixed with 3.0RC2.
Comment 5 Martin Oberhuber CLA 2012-05-23 16:46:07 EDT
Comment on attachment 78383 [details]
Adds a Quiesce state to System Profiles

Patch is obsolete since this was fixed differently as per comment 3.