View | Details | Raw Unified | Return to bug 200735
Collapse All | Expand All

(-)src/org/eclipse/rse/internal/core/model/SystemProfileManager.java (-1 / +2 lines)
Lines 14-19 Link Here
14
 * David Dykstal (IBM) - created and used RSEPreferencesManager
14
 * David Dykstal (IBM) - created and used RSEPreferencesManager
15
 *                     - moved SystemPreferencesManager to a new plugin
15
 *                     - moved SystemPreferencesManager to a new plugin
16
 * Kevin Doyle (IBM) - [197199] Renaming a Profile doesn't cause a save
16
 * Kevin Doyle (IBM) - [197199] Renaming a Profile doesn't cause a save
17
 * Kevin Doyle (IBM) - [200735] Delete a profile and it returns after restart with no connections
17
 ********************************************************************************/
18
 ********************************************************************************/
18
19
19
package org.eclipse.rse.internal.core.model;
20
package org.eclipse.rse.internal.core.model;
Lines 178-184 Link Here
178
			RSEPreferencesManager.renameActiveProfile(oldName, newName);
179
			RSEPreferencesManager.renameActiveProfile(oldName, newName);
179
		}
180
		}
180
		// Commit the profile to reflect the name change
181
		// Commit the profile to reflect the name change
181
		RSECorePlugin.getThePersistenceManager().commitProfile(profile, 5000);
182
		profile.commit();
182
		// Delete the profile by the old name, which is done in a separate job.
183
		// Delete the profile by the old name, which is done in a separate job.
183
		RSECorePlugin.getThePersistenceManager().deleteProfile(profile.getPersistenceProvider(), oldName);
184
		RSECorePlugin.getThePersistenceManager().deleteProfile(profile.getPersistenceProvider(), oldName);
184
	}
185
	}
(-)src/org/eclipse/rse/internal/core/model/SystemProfile.java (-2 / +34 lines)
Lines 14-19 Link Here
14
 * David Dykstal (IBM) - 142806: refactoring persistence framework
14
 * David Dykstal (IBM) - 142806: refactoring persistence framework
15
 * Martin Oberhuber (Wind River) - [184095] Replace systemTypeName by IRSESystemType
15
 * Martin Oberhuber (Wind River) - [184095] Replace systemTypeName by IRSESystemType
16
 * Martin Oberhuber (Wind River) - [177523] Unify singleton getter methods
16
 * Martin Oberhuber (Wind River) - [177523] Unify singleton getter methods
17
 * Kevin Doyle (IBM) - [200735] Delete a profile and it returns after restart with no connections
17
 ********************************************************************************/
18
 ********************************************************************************/
18
19
19
package org.eclipse.rse.internal.core.model;
20
package org.eclipse.rse.internal.core.model;
Lines 50-55 Link Here
50
	private boolean isActive = true;
51
	private boolean isActive = true;
51
	private String name = null;
52
	private String name = null;
52
	private boolean defaultPrivate = false;
53
	private boolean defaultPrivate = false;
54
	private boolean quiesceState = false;
53
55
54
	/**
56
	/**
55
	 * Default constructor
57
	 * Default constructor
Lines 212-219 Link Here
212
	public boolean commit() 
214
	public boolean commit() 
213
	{
215
	{
214
		boolean result = false;
216
		boolean result = false;
215
		if (!RSECorePlugin.getThePersistenceManager().isBusy()) {
217
		if (!quiesceState) {
216
			result = RSECorePlugin.getThePersistenceManager().commitProfile(this, 5000);
218
			// Need to check if busy otherwise Initialize RSE job will take forever
219
			// because all the commit's are waiting to acquire a lock.
220
			if (!RSECorePlugin.getThePersistenceManager().isBusy()) {
221
				result = RSECorePlugin.getThePersistenceManager().commitProfile(this, 5000);
222
			}
223
		} else {
224
			setDirty(true);
217
		}
225
		}
218
		return result;
226
		return result;
219
	}
227
	}
Lines 250-253 Link Here
250
		this.provider = provider;
258
		this.provider = provider;
251
	}
259
	}
252
	
260
	
261
	/**
262
	 * Sets the quiesce state of the profile.  If this is set to true
263
	 * then commits will be ignored.  If this is set to false then
264
	 * it will check if the profile is dirty and commit the profile
265
	 * if needed and future commits won't be ignored.
266
	 * @param state The quiesce state of the profile.
267
	 */
268
	public void setQuiesceState(final boolean state) {
269
		quiesceState = state;
270
		// If we are changing the quiesce state to false
271
		// and the profile is dirty then we need to do a commit
272
		if (!quiesceState && isDirty()) {
273
			commit();
274
		}
275
	}
276
	
277
	/**
278
	 * Returns the quiesce state of the profile.
279
	 * @return <code>true</code> if the profile is in the quiesce state
280
	 * else <code>false</code>.
281
	 */
282
	public boolean getQuiesceState() {
283
		return quiesceState;
284
	}
253
}
285
}
(-)src/org/eclipse/rse/internal/persistence/RSEPersistenceManager.java (-1 / +2 lines)
Lines 17-22 Link Here
17
 * Martin Oberhuber (Wind River) - [175680] Deprecate obsolete ISystemRegistry methods
17
 * Martin Oberhuber (Wind River) - [175680] Deprecate obsolete ISystemRegistry methods
18
 * Martin Oberhuber (Wind River) - [196919] Fix deadlock with workspace operations
18
 * Martin Oberhuber (Wind River) - [196919] Fix deadlock with workspace operations
19
 * Martin Oberhuber (Wind River) - [202416] Protect against NPEs when importing DOM
19
 * Martin Oberhuber (Wind River) - [202416] Protect against NPEs when importing DOM
20
 * Kevin Doyle (IBM) - [200735] Delete a profile and it returns after restart with no connections
20
 ********************************************************************************/
21
 ********************************************************************************/
21
22
22
package org.eclipse.rse.internal.persistence;
23
package org.eclipse.rse.internal.persistence;
Lines 149-155 Link Here
149
		for (int idx = 0; idx < profiles.length; idx++) {
150
		for (int idx = 0; idx < profiles.length; idx++) {
150
			ISystemProfile profile = profiles[idx];
151
			ISystemProfile profile = profiles[idx];
151
			try {
152
			try {
152
				boolean ok = commitProfile(profile, timeout);
153
				boolean ok = profile.commit();
153
				if (!ok) {
154
				if (!ok) {
154
					failed.add(profile);
155
					failed.add(profile);
155
				}
156
				}
(-)model/org/eclipse/rse/ui/internal/model/SystemRegistry.java (+7 lines)
Lines 35-40 Link Here
35
 * David McKnight   (IBM)        - [165674] Sort subsystem configurations to be in deterministic order
35
 * David McKnight   (IBM)        - [165674] Sort subsystem configurations to be in deterministic order
36
 * Martin Oberhuber (Wind River) - [165674] Sort subsystem configurations by priority then Id
36
 * Martin Oberhuber (Wind River) - [165674] Sort subsystem configurations by priority then Id
37
 * Martin Oberhuber (Wind River) - [194898] Avoid NPE when doing EVENT_REFRESH_REMOTE on a subsys without filters
37
 * Martin Oberhuber (Wind River) - [194898] Avoid NPE when doing EVENT_REFRESH_REMOTE on a subsys without filters
38
 * Kevin Doyle (IBM) - [200735] Delete a profile and it returns after restart with no connections
38
 ********************************************************************************/
39
 ********************************************************************************/
39
40
40
package org.eclipse.rse.ui.internal.model;
41
package org.eclipse.rse.ui.internal.model;
Lines 90-95 Link Here
90
import org.eclipse.rse.internal.core.model.SystemModelChangeEvent;
91
import org.eclipse.rse.internal.core.model.SystemModelChangeEvent;
91
import org.eclipse.rse.internal.core.model.SystemModelChangeEventManager;
92
import org.eclipse.rse.internal.core.model.SystemModelChangeEventManager;
92
import org.eclipse.rse.internal.core.model.SystemPreferenceChangeManager;
93
import org.eclipse.rse.internal.core.model.SystemPreferenceChangeManager;
94
import org.eclipse.rse.internal.core.model.SystemProfile;
93
import org.eclipse.rse.internal.core.model.SystemProfileManager;
95
import org.eclipse.rse.internal.core.model.SystemProfileManager;
94
import org.eclipse.rse.internal.core.model.SystemRemoteChangeEventManager;
96
import org.eclipse.rse.internal.core.model.SystemRemoteChangeEventManager;
95
import org.eclipse.rse.services.clientserver.messages.SystemMessage;
97
import org.eclipse.rse.services.clientserver.messages.SystemMessage;
Lines 732-737 Link Here
732
	 */
734
	 */
733
	public void deleteSystemProfile(ISystemProfile profile) throws Exception
735
	public void deleteSystemProfile(ISystemProfile profile) throws Exception
734
	{
736
	{
737
		// Set the profile into Quiesce state
738
		if (profile instanceof SystemProfile) {
739
			((SystemProfile) profile).setQuiesceState(true);
740
		}
741
		
735
		// step 0: load the world!
742
		// step 0: load the world!
736
		loadAll(); // force the world into memory!
743
		loadAll(); // force the world into memory!
737
744

Return to bug 200735