[QGIS-Developer] Editing buffer and commitChanges order
apasotti at gmail.com
Mon Nov 20 04:02:47 PST 2017
I'm facing a bug  that led me to a potential issue in the editing buffer
implementation: when commitChanges is called, different operations (change
geometry, change attrs, add features, delete features ...) are grouped and
executed in a fixed order.
So, if I wanted for example insert a feature and (after the insert has been
change the geometry of another feature I cannot do that because all
geometry editing operations are grouped and executed before all the insert
feature operations are executed 
This issue can lead to data loss in several scenarios, one is the bug I'm
working on here but there are more: for example when you want to merge
features you cannot delete features after you have successfully created the
merged one, just because all delete operations are performed before the
I guess that by grouping related commands together we probably wanted to
make it easier to optimize the operations in the back-end.
Wrapping the commitChanges into transactions would help with DB-like
backends that support it (I think that the implementation is not yet
completed), but I'm still convinced that the order of edit commands within
an editing buffer should be respected (that does not mean that certain
commands cannot be grouped if the programmer choose to do so).
I'd like to hear your opinion about the possible solutions to this problem.
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the QGIS-Developer