[Qgis-developer] Proposed plan to fix issue with concurrent opening of OGR datasources (aka QGIS and MapInfo)

Matthias Kuhn matthias at opengis.ch
Tue Mar 22 05:53:10 PDT 2016



On 03/22/2016 01:44 PM, Hugo Mercier wrote:
>
> On 22/03/2016 12:11, Even Rouault wrote:
>
>>>> True.
>>>> But you can also directly access the provider update methods without
>>>> edit buffers and without startEditing / commitChanges.
>>> Good point. I didn't think at that use case of direct access to the
>>> provider API.
>>>
>>>> ... but after all ... if I understood correctly your intents, for
>>>> existing codes that use this direct provider access, update functions
>>>> will reopen the source in write mode and they will always stay in that
>>>> mode because the endEdit() method will never be called ?
>>> Yes.
>>>
>>> One possibility would be also to go back to read-only mode with a timer.
>>> For a write operation, outside of beginEdit() / endEdit(), that lead to
>>> re-opening in update-mode, after X seconds without write activity, the
>>> dataset would be re-opened in update mode.
>> correction: "...would be re-opened in *read-only* mode"
>>
> I am not sure to like this timeout ... I prefer when the state of
> objects does not silently change in background :)
> Doing nothing would be ok: existing (plugin) codes would lock under
> windows, which is already the case, and would have the opportunity to be
> safer by calling endEdit().

What about adding the re-open file code at the beginning and end of the
dataprovider functions (QgsOgrProvider::addFeatures etc.)?

If we're afraid that there is too little control this way, we could
still add a controlled "update state" to the provider and in case this
is already set, the re-opening will be skipped.

Matthias

> _______________________________________________
> Qgis-developer mailing list
> Qgis-developer at lists.osgeo.org
> List info: http://lists.osgeo.org/mailman/listinfo/qgis-developer
> Unsubscribe: http://lists.osgeo.org/mailman/listinfo/qgis-developer

-- 
Matthias Kuhn
OPENGIS.ch - https://www.opengis.ch
Spatial • (Q)GIS • PostGIS • Open Source


-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: OpenPGP digital signature
URL: <http://lists.osgeo.org/pipermail/qgis-developer/attachments/20160322/ea54475a/attachment.sig>


More information about the Qgis-developer mailing list