Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

"Database is locked" error in SQLite over a Mac network

I have created a simple database using SQLite (actually PySQLite). It works fine when I'm querying or writing to the database from the local machine (ie program and database file on the windows machine drive). However when I copy the database file to my network drive (a time capsule), then Windows machines, although they can see the files and have full read/write access to the drive, give me a "SQL Error: database is locked" even when performing a simple select!

Queries work fine over the network from Macs.

There is no fancy multi-access going on - only one machine has the database open. Seems like some weird Mac networking issue. Happens in either the Python program, or in the SQLite3 command line. I am using SQLite 3.6.14.2.

Anybody seen this problem? Any way of fixing it? Don't really want to get heavy with MYSQL because this is a simple single-user program, but i'd like to use it from multiple machines.

Thanks.


1 Answers

I don't know if it can be done on MAC, on Debian I have to mount the samba directory with the nobrl option.

From mount.cifs(8):

  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).
like image 53
Carlos Avatar answered Sep 21 '25 23:09

Carlos