Bug report #15498

SQLite/GPKG database locked during canvas refresh

Added by Jakub Kosik over 7 years ago. Updated over 6 years ago.

Status:Closed
Priority:High
Assignee:-
Category:Data Provider/SpatiaLite
Affected QGIS version:2.18.13 Regression?:Yes
Operating System: Easy fix?:No
Pull Request or Patch supplied:No Resolution:
Crashes QGIS or corrupts data:No Copied to github as #:23422

Description

As above, during canvas refresh (only sqlite layers), when redraw isn't finished - hit "save edits" causes SQLite error "database is locked". Same error with python plugin and addFeatures directly into provider.
Problem tested on 2.14.3, 2.14.5, 2.14.6, there was no problems with 2.8

Associated revisions

Revision 8364b8d7
Added by Luigi Pirelli over 6 years ago

in case SQlite vectors wait end of rendering to avoid file lock: fixes #15498

Revision 63219239
Added by Alessandro Pasotti over 6 years ago

Merge pull request #5305 from boundlessgeo/issue_15498_waitRenederingEndToAvoidLock

for SQlite vectors wait rendering end to avoid file lock: fixes #15498

History

#1 Updated by Giovanni Manghi about 7 years ago

  • Target version set to Version 2.18
  • Affected QGIS version changed from 2.14.5 to 2.18.4

Seen also on 2.18.4, geopackage seems not affected.

#2 Updated by Giovanni Manghi almost 7 years ago

  • Regression? set to Yes

#3 Updated by Giovanni Manghi almost 7 years ago

  • Priority changed from Severe/Regression to High

#4 Updated by Giovanni Manghi almost 7 years ago

  • Easy fix? set to No

#5 Updated by Giovanni Manghi over 6 years ago

  • Affected QGIS version changed from 2.18.4 to 2.18.13
  • Description updated (diff)

#6 Updated by Luigi Pirelli over 6 years ago

Ok, it can be a regression, but IMHO the behaviour is correct in this way respect allowing to write during rendering.
If layer is modified during rendering, theoretically rendering have to be invalidated. Stopping rendering is always possible with rendering checkbox in the bottom bar => the correct procedure would be:
1) stop rendering
2) save features
3) refresh

or

1) during save => stop rendering
2) save edit
3) refresh

the above would be a new feature that is not strictly necessary because of manual workaround.

can it be considered a low priority issue, and more, can it be considered a fix instead of a regression?

#7 Updated by Giovanni Manghi over 6 years ago

Seen also for GPKGs.

#8 Updated by Giovanni Manghi over 6 years ago

  • Subject changed from SQLite database locked during canvas refresh to SQLite/GPKG database locked during canvas refresh

#9 Updated by Giovanni Manghi over 6 years ago

Luigi Pirelli wrote:

Ok, it can be a regression, but IMHO the behaviour is much more correct in hti sway that allowing to werite during rendering.
In layer is modified during rendering, theoretically rendering have to be invalidated. Stopping rendering is always possible with rendering checkbox in the bottom bar => trhe correct procedure would be:
1) stop rendering
2) save features
3) refresh

or

1) during save => stop rendering
2) save edit
3) refresh

the above would be a new feature that not strictly necessary because of manual workaround.

can be it considered a high priority issue and more can be considered a regression or better fix on a not correct behaviour on 2.14?

Luigi, I'm really not sure. I suggest to ask this in the dev list for a wider feeeback.

#10 Updated by Luigi Pirelli over 6 years ago

  • Status changed from Open to Closed
  • % Done changed from 0 to 100

Also available in: Atom PDF