Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

editing several layers in geopackage - database is locked #23676

Closed
qgib opened this issue Oct 25, 2016 · 9 comments
Closed

editing several layers in geopackage - database is locked #23676

qgib opened this issue Oct 25, 2016 · 9 comments
Labels
Bug Either a bug report, or a bug fix. Let's hope for the latter! Data Provider Related to specific vector, raster or mesh data providers

Comments

@qgib
Copy link
Contributor

qgib commented Oct 25, 2016

Author Name: Jochen Huber (@huber-j)
Original Redmine Issue: 15754
Affected QGIS version: 2.18.0
Redmine category:data_provider/ogr


In a QGIS project with several layers from a single geopackage database, the following problem frequently occurs:
Switch layer to editing mode, do geometry edits, save edits, deactivate layer editing mode.
Switch second layer to editing mode, do geometry edits, try to save edits -> Database provider errors (OGR) e.g. "failed to execute insert: database is locked".
After closing QGIS and reopening the same project, the second layer can be edited and the edits are successfully saved, but the problem occurs again when another layer from the same geopackage is edited.
Maybe this problem is related to the one in #23283.


@qgib
Copy link
Contributor Author

qgib commented Dec 21, 2016

Author Name: Even Rouault (@rouault)


I tried with master on Linux with the attached DB and couldn't reproduce the issue (I'm attaching the simple DB I used for reference). Normally locking issues should have been fixed in 2.18.0 per #0497e4a454c7ad689a0fc7b767208f95d53266b0. Can you have provide a reproducable procedure + test DB ?


  • 10611 was configured as test.gpkg

@qgib
Copy link
Contributor Author

qgib commented Dec 22, 2016

Author Name: Jochen Huber (@huber-j)


I tried again with the sample DB you supplied and still experienced the same problem. Open QGIS, create a new project, add all layers from the DB, edit the geometry of one layer and save, edit the geometry of the second layer -> saving fails.
A test with the DB located on a local drive did NOT show the problem, prompting further investigation:

  • Network share on Windows Server 2008 R2 Standard, Access via domain-integrated DFS (Distributed File System): Problem occurs
  • Network share on Windows Server 2008 R2 Standard, direct access to server: Works fine
  • Network share on Windows Server 2012 R2 Standard (direct access), Windows 7 Professional SP 1, QNAP NAS or Western Digital MyBook Live: Works fine

So this seems to be a problem which only occurs when accessing a network share via DFS (which is the standard case in our company). Interestingly, there is no problem with Spatialite DBs, so there seems to be a difference in how QGIS accesses Geopackage DBs vs. Spatialite DBs.

@qgib
Copy link
Contributor Author

qgib commented Feb 6, 2017

Author Name: Jérôme Guélat (Jérôme Guélat)


We are also experiencing this problem with QGIS 2.18.3 (OGR/GDAL 2.1.3) on Windows.

@qgib
Copy link
Contributor Author

qgib commented Feb 7, 2017

Author Name: Ger CO (Ger CO)


Same here on Win 7 and qgis 2.18.3

@qgib
Copy link
Contributor Author

qgib commented Apr 30, 2017

Author Name: Giovanni Manghi (@gioman)


  • easy_fix was configured as 0
  • regression was configured as 0

@qgib
Copy link
Contributor Author

qgib commented Nov 10, 2017

Author Name: Even Rouault (@rouault)


Can anyone retry with QGIS master ? Changes done in 8f3d44d should likely fix that


  • description was changed from In a QGIS project with several layers from a single geopackage database, the following problem frequently occurs:
    Switch layer to editing mode, do geometry edits, save edits, deactivate layer editing mode.
    Switch second layer to editing mode, do geometry edits, try to save edits -> Database provider errors (OGR) e.g. "failed to execute insert: database is locked".
    After closing QGIS and reopening the same project, the second layer can be edited and the edits are successfully saved, but the problem occurs again when another layer from the same geopackage is edited.
    Maybe this problem is related to the one in geopackage edits workflow is broken #23283. to In a QGIS project with several layers from a single geopackage database, the following problem frequently occurs:
    Switch layer to editing mode, do geometry edits, save edits, deactivate layer editing mode.
    Switch second layer to editing mode, do geometry edits, try to save edits -> Database provider errors (OGR) e.g. "failed to execute insert: database is locked".
    After closing QGIS and reopening the same project, the second layer can be edited and the edits are successfully saved, but the problem occurs again when another layer from the same geopackage is edited.
    Maybe this problem is related to the one in geopackage edits workflow is broken #23283.
  • status_id was changed from Open to Feedback

@qgib
Copy link
Contributor Author

qgib commented Nov 21, 2017

Author Name: Jochen Huber (@huber-j)


I tried with QGIS master (2.99.0, code version af5b2a7) and also on 2.18.14. I didn't experience the problem any more on both versions (not only on master).

@qgib
Copy link
Contributor Author

qgib commented Nov 21, 2017

Author Name: Giovanni Manghi (@gioman)


  • status_id was changed from Feedback to Closed
  • resolution was changed from to fixed/implemented

@qgib qgib closed this as completed Nov 21, 2017
@qgib qgib added Bug Either a bug report, or a bug fix. Let's hope for the latter! Data Provider Related to specific vector, raster or mesh data providers labels May 25, 2019
@djes
Copy link

djes commented Aug 26, 2019

Have this bug today. Geopackage on a network share, several layers edited. Last edit cannot be saved, "database is locked". Bug occured on 3.4.1 and 3.6.3.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug Either a bug report, or a bug fix. Let's hope for the latter! Data Provider Related to specific vector, raster or mesh data providers
Projects
None yet
Development

No branches or pull requests

2 participants