Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 336688 - [DB] Too many unreasonably opened connections to DB
Summary: [DB] Too many unreasonably opened connections to DB
Status: CLOSED FIXED
Alias: None
Product: EMF
Classification: Modeling
Component: cdo.db (show other bugs)
Version: 4.0   Edit
Hardware: PC Mac OS X - Carbon (unsup.)
: P3 normal (vote)
Target Milestone: ---   Edit
Assignee: Egidijus Vaisnora CLA
QA Contact: Eike Stepper CLA
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-02-09 04:37 EST by Egidijus Vaisnora CLA
Modified: 2011-06-23 03:42 EDT (History)
0 users

See Also:
vaisegid: review?


Attachments
Patch v1 (9.93 KB, patch)
2011-02-09 04:42 EST, Egidijus Vaisnora CLA
no flags Details | Diff
Patch v2 - fixed conflict with remote changes (10.08 KB, patch)
2011-02-09 05:08 EST, Egidijus Vaisnora CLA
no flags Details | Diff
Patch v3 - now it looks to be workspace patch (10.15 KB, patch)
2011-02-10 04:57 EST, Egidijus Vaisnora CLA
no flags Details | Diff
Patch v4 - ready to be committed (27.18 KB, patch)
2011-02-10 10:13 EST, Eike Stepper CLA
no flags Details | Diff

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