Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 332800 - DataSourceTracker.removeService method invocation not expected
Summary: DataSourceTracker.removeService method invocation not expected
Status: RESOLVED FIXED
Alias: None
Product: Gemini.JPA
Classification: RT
Component: Core (show other bugs)
Version: unspecified   Edit
Hardware: PC Windows XP
: P3 normal (vote)
Target Milestone: 1.0.0 RC3   Edit
Assignee: Michael Keith CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-12-16 17:35 EST by Michael Keith CLA
Modified: 2011-08-16 13:31 EDT (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
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.