"Database locked" error in SQLite over Mac network

I created a simple database using SQLite (actually PySQLite). It works great when I query or write to the database from my local computer (i.e. Program and Database file on Windows drive). However, when I copy the database file to my network drive (time capsule), then to Windows computers, although they can see the files and have full read / write access to the drive, give me a "SQL error: database is locked" even though making a simple choice!

Queries work fine over the network from Mac computers.

There is no fancy multiple access - only one machine opens the database. Seems like some weird Mac networking issue. This happens either in a Python program or on the SQLite3 command line. I am using SQLite 3.6.14.2.

Has anyone seen this issue? Any way to fix it? Actually, I don't want to load MYSQL too much, because it is a simple single-user program, but I would like to use it from multiple computers.

Thanks.

+1


a source to share


4 answers


I don't know if this can be done on MAC, on Debian I need to set the samba directory with the nobrl option .

From mount.cifs (8) file:



  nobrl
      Do not send byte range lock requests to the server. This is
      necessary for certain applications that break with cifs
      style mandatory byte range locks (and most cifs servers do
      not yet support requesting advisory byte range locks).

      

+3


a source


Read the FAQ for sqlite: http://www.sqlite.org/faq.html#q5

"People who have a lot of experience with Windows tell me that blocking network files is very difficult and not reliable. If what they say is true, sharing a SQLite database between two or more Windows computers can cause unexpected problems."



So it doesn't work on Windows, it doesn't say MAC.

+2


a source


It may not be able to block the file over the network, I think you are using SMB protocol, so the error is package related. If you would like to use SQLite over the network, see SQLite Network for alternatives.

+1


a source


I had a similar problem and solved it by installing a new version of sqlite. With Python 2.6, the problem went away due to the fact that it uses the newer sqlite-dll.

0


a source







All Articles