Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 332800

Summary: DataSourceTracker.removeService method invocation not expected
Product: [RT] Gemini.JPA Reporter: Michael Keith <michael.keith>
Component: CoreAssignee: Michael Keith <michael.keith>
Status: RESOLVED FIXED QA Contact:
Severity: normal    
Priority: P3    
Version: unspecified   
Target Milestone: 1.0.0 RC3   
Hardware: PC   
OS: Windows XP   
Whiteboard:

Description Michael Keith CLA 2010-12-16 17:35:49 EST
When the persistence unit bundle is being stopped then the provider.unregisterPersistenceUnits method is called, which then calls  GeminiServiceUtil.unregisterEMFService. It calls stopTrackingDataSourceFactory, which causes the removedService method to be invoked. This is not expected and causes premature EMF.close(), so the EMF is already closed before the unregisterPersistenceUnits expects it to be. The code is not broken since the EMF does get closed, which is what needs to happen anyway, but it just gets closed earlier than what was expected. The code should be cleaned up and follow a code flow that is better documented and easier to understand.
Comment 1 Michael Keith CLA 2011-08-16 13:31:36 EDT
Reworked the DSF tracker code when adding the dependency tracking.