<div dir="ltr">Is this a solution for <a href="http://hub.qgis.org/issues/7540">http://hub.qgis.org/issues/7540</a> ?</div><div class="gmail_extra"><br><br><div class="gmail_quote">2013/4/20 Radim Blazek <span dir="ltr"><<a href="mailto:radim.blazek@gmail.com" target="_blank">radim.blazek@gmail.com</a>></span><br>

<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">On Fri, Apr 19, 2013 at 12:07 PM, JVerholle <<a href="mailto:julien.verholle@eaurmc.fr">julien.verholle@eaurmc.fr</a>> wrote:<br>


> Hi all,<br>
><br>
> If I want to open the same shapefile in both softwares at the same time, the<br>
> file is locked in ArcGis (even if the edition mode isn't used in QGis).<br>
<br>
QGIS opens layers (files) in update mode ("r+") if possible (file<br>
permission + OGR driver support). It may (but also may not) be a<br>
problem also for #6448 (slow shp over network) I am currently<br>
struggling with. In general, I think that it is bad to open files<br>
always in update mode even if in most cases they are not going to be<br>
edited.<br>
<br>
Currently there are no QgsVectorDataProvider::startEditing() and<br>
commitChanges() which may also be a problem for database providers<br>
because QgsVectorLayerEditBuffer::commitChanges() calls more provider<br>
methods changing<br>
data (deleteAttributes, addAttributes, deleteFeatures,<br>
addFeatures...).  The commitChanges() should do everything in one<br>
transaction IMO.<br>
<br>
My proposal is to:<br>
1) Add QgsVectorDataProvider::startEditing() and<br>
QgsVectorDataProvider::commitChanges()<br>
2) In OGR provider try to open layer in update mode only to get<br>
capabilities (get info if it can be modified when the provider is<br>
constructed) but then to reopen in read only mode.<br>
3) Call QgsVectorDataProvider::startEditing() from<br>
QgsVectorLayer::startEditing() to be sure that the layer is still<br>
editable (permissions could change or it was opened by another<br>
application for editing since the layer was opened) and to reopen<br>
files in update mode (files based) or to start transaction (DB based).<br>
4) Call QgsVectorDataProvider::commitChanges() from<br>
QgsVectorLayer::commitChanges()<br>
4) In QgsOgrProvider::startEditing() reopen the layer in update mode<br>
5) In QgsOgrProvider::commitChanges() reopen the layer in read only mode<br>
<br>
I am not sure if reopening of layers in OGR provider may be a<br>
performance problem, but I hope that it should not be.<br>
<br>
We don't really have to implement startEditing() and commitChanges()<br>
in all providers for 2.0, but it should be in the vector API.<br>
<br>
Radim<br>
<br>
PS: Unfortunately, according to my current knowledge, this is not full<br>
solution for #6448.<br>
<br>
> ArcGis is enable to recognize the feature's type (we can see a "?" instead<br>
> of polylign, polygon or point).<br>
> This issue has been only noticed on Windows (and with ArcMap 9.2).<br>
><br>
> Someone has already seen this problem ? Is it due to QGis or Gdal ?<br>
><br>
> Thanks.<br>
><br>
> Julien<br>
><br>
><br>
><br>
> --<br>
> View this message in context: <a href="http://osgeo-org.1560.x6.nabble.com/Interaction-between-QGis-and-ArcGis-tp5048256.html" target="_blank">http://osgeo-org.1560.x6.nabble.com/Interaction-between-QGis-and-ArcGis-tp5048256.html</a><br>


> Sent from the Quantum GIS - Developer mailing list archive at Nabble.com.<br>
> _______________________________________________<br>
> Qgis-developer mailing list<br>
> <a href="mailto:Qgis-developer@lists.osgeo.org">Qgis-developer@lists.osgeo.org</a><br>
> <a href="http://lists.osgeo.org/mailman/listinfo/qgis-developer" target="_blank">http://lists.osgeo.org/mailman/listinfo/qgis-developer</a><br>
_______________________________________________<br>
Qgis-developer mailing list<br>
<a href="mailto:Qgis-developer@lists.osgeo.org">Qgis-developer@lists.osgeo.org</a><br>
<a href="http://lists.osgeo.org/mailman/listinfo/qgis-developer" target="_blank">http://lists.osgeo.org/mailman/listinfo/qgis-developer</a><br>
</blockquote></div><br></div>