Bug report #14764
Commit "Pass the full ogr data source URI as connInfo in qgsConnectionPool_ConnectionCreate" cancels the benefits of OGR connection pooling
|Affected QGIS version:||2.14.2||Regression?:||No|
|Operating System:||Easy fix?:||No|
|Pull Request or Patch supplied:||No||Resolution:|
|Crashes QGIS or corrupts data:||No||Copied to github as #:||22721|
79493ea, done per #14560, (that was also cherry picked in 2.14 branch as c913e83, and got in the 2.14.2 OSGeo4W Windows binaries despite being after the git
final-2_14_2 tag, as OSGeo4W 2.14.2-1 is actually built from f5763f0 as the help dialog box confirms it) has the side effect of disabling in practice the benefits of OGR connection pooling added in b4f4663. That can be seen by a lot of dataset opening and closing with
CPL_DEBUG=ON when scrolling through the attribute table, or zooming-in/out/panning on the map canvas.
The reason is that
unref() on the filepath whereas
QgsOgrFeatureSource on the datasource URI.
(I'm wondering if another option to 79493ea would have perhaps just be to call
OGR_L_ResetReading(ogrlayer) after acquiring the connection and the layer)