[Qgis-developer] Spatialite database locked after layer removal.

John Stevenson john.stevenson at thinkwhere.com
Tue Oct 27 02:18:04 PDT 2015


I am having trouble renaming a spatialite database that I have been using in QGIS (2.10.1-Pisa).  I have been working in Python, but the problem can be easily recreated through the GUI.

1)      Add spatialite layer from sqlite file

2)      Remove spatialite layer (right click, remove)

3)      Rename or delete the sqlite file

Python gives ‘WindowsError’ in Windows 7, or ‘OSError’ in Xubuntu 14.04.  The Linux terminal gets:
mv: cannot move ‘test.sqlite’ to ‘test2.sqlite’: Text file busy

After a few (1-5?) minutes the lock is removed.

With shape file layers, the lock is removed as soon as the layer is removed.  Is there a reason for the delay with the spatialite file?  Is there a command that I can call to refresh/drop the connection more quickly?


John Stevenson
Senior Developer

[cid:image62d446.PNG at b8f67a6f.44b02e71]<http://www.thinkwhere.com>

t: 01786 476060 (Office)
t: 01786 476093 (Direct Dial)

Glendevon House
Castle Business Park
Stirling FK9 4TZ

[cid:image4b9582.PNG at 2ece2541.49a15f3b]<https://twitter.com/thinkWhere1> [cid:image1d9004.PNG at 2583645c.4eb76c05] <http://www.linkedin.com/company/1509510?trk=companies_home_ycp_logo_forth-valley-gis>

This email and its attachments are private and confidential. If you believe you have received this email in error, please contact the sender immediately on 01786 476060. If you are not the intended recipient, you may not rely on, use or disclose this email or any attachments in any way.

thinkWhere Limited does not accept any liability for any damage that may be caused to the recipient's system or data by this email or any attachments. Please note that our email system may be subject to random monitoring by us. This Company accepts no liability for personal emails.

thinkWhere is a limited company registered in Scotland with Registered Number SC315349 and having its Registered Office at Glendevon House, Castle Business Park, Stirling, FK9 4TZ.

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/qgis-developer/attachments/20151027/03532488/attachment-0001.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: image62d446.PNG
Type: image/png
Size: 7004 bytes
Desc: image62d446.PNG
URL: <http://lists.osgeo.org/pipermail/qgis-developer/attachments/20151027/03532488/attachment-0003.png>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: image4b9582.PNG
Type: image/png
Size: 3618 bytes
Desc: image4b9582.PNG
URL: <http://lists.osgeo.org/pipermail/qgis-developer/attachments/20151027/03532488/attachment-0004.png>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: image1d9004.PNG
Type: image/png
Size: 3751 bytes
Desc: image1d9004.PNG
URL: <http://lists.osgeo.org/pipermail/qgis-developer/attachments/20151027/03532488/attachment-0005.png>

More information about the Qgis-developer mailing list