On 29 Jul 2011, at 07:49, Jonathan Little wrote:

Hello,

I am no expert in sqlite, but I do use it one of our projects. My  
interpretation of the documentation is slightly different to yours -  
see below

> Specifically, that page says that locking_mode = EXCLUSIVE is useful  
> if "The application wants to prevent other processes from accessing  
> the database file."

The documentation on that page also says:

``This pragma sets or queries the database connection locking-mode.''

> However, if I start up a SQLite shell, set the locking_mode to  
> exclusive, and perform an insert or other write operation (such that  
> the exclusive lock should be acquired and not released), I can still  
> read the file from other processes (e.g. I can copy it using a file  
> manager UI).

Are these processes making a connection to the database? If no, why  
would you expect them to obey locking_mode?

> Am I missing something here or if I want to prevent this, is my only  
> option to modify our build of SQLite to open the file for exclusive  
> access?

That is certainly not your only option. Personally, I would create a  
program that makes a database connection (which will take account of  
the locks), and copies everything relevant into another database.  
After the user has run this to create their copy, they can then do  
what they want with it.

Kevin Martin
_______________________________________________
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

Reply via email to