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

Bug 336688

Summary: [DB] Too many unreasonably opened connections to DB
Product: [Modeling] EMF Reporter: Egidijus Vaisnora <vaisegid>
Component: cdo.dbAssignee: Egidijus Vaisnora <vaisegid>
Status: CLOSED FIXED QA Contact: Eike Stepper <stepper>
Severity: normal    
Priority: P3 Flags: vaisegid: review?
Version: 4.0   
Target Milestone: ---   
Hardware: PC   
OS: Mac OS X - Carbon (unsup.)   
Whiteboard:
Attachments:
Description Flags
Patch v1
none
Patch v2 - fixed conflict with remote changes
none
Patch v3 - now it looks to be workspace patch
none
Patch v4 - ready to be committed none

Description Egidijus Vaisnora CLA 2011-02-09 04:37:11 EST
Seems that method HorizontalAuditMappingStrategy.getUniqueID creates every time new connection to DB and after executing it - closes.
Comment 1 Egidijus Vaisnora CLA 2011-02-09 04:42:22 EST
Created attachment 188574 [details]
Patch v1

MetaDataManager modified to get Accessor from StoreThreadLocal (it seems to be always present).
Advantage is that now methods getMetaID and getMetaInstance from MetaDataManager always will check cache first and no new accessors will be created
Comment 2 Egidijus Vaisnora CLA 2011-02-09 05:08:50 EST
Created attachment 188575 [details]
Patch v2 - fixed conflict with remote changes
Comment 3 Egidijus Vaisnora CLA 2011-02-09 05:35:56 EST
There are few other places, where code opens new DB connection, like in method Repository.initSystemPackages, which consumes connection from pool, but doesn't put it back. And there is a comment like "Don't let the null-context accessor go to the pool!". Why we cannot put accessor back to the pool?
Comment 4 Eike Stepper CLA 2011-02-10 02:57:01 EST
Your patch is not workspace-relative ;-(
Comment 5 Egidijus Vaisnora CLA 2011-02-10 04:57:12 EST
Created attachment 188665 [details]
Patch v3 - now it looks to be workspace patch
Comment 6 Eike Stepper CLA 2011-02-10 10:13:39 EST
Created attachment 188687 [details]
Patch v4 - ready to be committed
Comment 7 Egidijus Vaisnora CLA 2011-02-10 10:32:21 EST
committed to trunk revision 7055
Comment 8 Eike Stepper CLA 2011-06-23 03:42:09 EDT
Available in R20110608-1407