[Qgis-developer] problem with feature request and updateFeature
Jürgen E. Fischer
jef at norbit.de
Sat Mar 23 11:19:59 PDT 2013
Hi,
On Fri, 22. Mar 2013 at 18:37:00 +0100, Matthias Kuhn wrote:
> or another in the upcoming months, even more when multithreading is
> introduced, but not all dataProviders are ready to play nice and allow
> multiple iterators run in parallel.
Not sure if any dataProviders currently work with multiple iterators.
> What do you think about introducing exceptions being thrown in such cases?
No much. We currently don't use exceptions at all (ok, at some internal
places, but not in the API). Qt doesn't use exceptions either. I don't
think it's worth to introduce exceptions just to workaround bugs.
> It would be easier to become aware and also to react to such problems.
> There can also be conditions, when the underlying data is edited while
> being iterated. I remember Java had something called fail-safe and
> fail-fast iterators, which might be worth revising for this case.
Can that work without revisiting the feature in the database?
> Concerning the current issue: If there is really no possibility to fix this
> without parallel iterators, at least the API should give a hint on these
> restrictions.
Ok.
On Sat, 23. Mar 2013 at 09:49:28 +1000, Nathan Woodrow wrote:
> Well the feature itself knows what values it started with. Every update in
> QgsFeature goes though the setAttribute, etc, call, you can just have an
> internal dictionary that logs when one of values is changed using those
> methods.
Sure, you could do that. But what for? Just for updateFeature? That method
is not even used anywhere.
And one instance of QgsFeature is often used as buffer, so the tracking would
have to be reset at some point (setValid? setFeatureId?).
IMHO one needs to be aware that currently multiple iterators are not working
for now. Maybe Martin can comment on this - I guess he has plans continue to
work on this and the current state is for the time being.
Jürgen
--
Jürgen E. Fischer norBIT GmbH Tel. +49-4931-918175-31
Dipl.-Inf. (FH) Rheinstraße 13 Fax. +49-4931-918175-50
Software Engineer D-26506 Norden http://www.norbit.de
committ(ed|ing) to Quantum GIS IRC: jef on FreeNode
--
norBIT Gesellschaft fuer Unternehmensberatung und Informationssysteme mbH
Rheinstrasse 13, 26506 Norden
GF: Jelto Buurman, HR: Amtsgericht Emden, HRB 5502
More information about the Qgis-developer
mailing list