The interesting part of the scenario is, when you change the file permission
using chmod 000 bulk.db, there is no effect on the process of writing (with
sqlite3_exec and busy handler combo) however the same does not work for the
chmod 444 bulk.db.

This make me suspect that there is some point which I am missing or may be
it is a defect in SQLite.

Anyways thanks for effort Joe


-----Original Message-----
From: Joe Wilson [mailto:[EMAIL PROTECTED] 
Sent: Wednesday, August 08, 2007 6:53 PM
To: sqlite-users@sqlite.org
Subject: Re: [sqlite] File Permission and Busy Handler Issue in SQLite

It is not reasonable to change a database file to read-only in the
middle of a transaction. I suppose sqlite could be changed to detect it,
but why bother?

By the same logic, if another process wrote random bytes in the middle
of an sqlite database file, should sqlite be responsible for recovering
from that as well?

--- Kiran <[EMAIL PROTECTED]> wrote:
> I am currently using SQLite in my application as in Multi-process
> environment. I.e. my application will contain multi-process which will
> handle add/delete request to a single db - (bulk.db). I am using the
> busy_handler concept (with 5ms delay) for locking issues.
> 
> However, during testing, when 5 processes is up and running, I by chance
> changed the file permission of bulk.db (chmod 444 bulk.db) to read only.
Now
> I see that the sqlite_exe is not able to trap the read-only mode error of
> the database (while it tries to add records) and is just returning a
> busy_handler and thus in loop. 
> 
> Bottom line, if you are using busy_handler and if DB file permission is
> changed to read-only (manually) instead of throwing an error, SQLite will
> continue triggering busy_handler. Thus not able to handle this situation.



       
____________________________________________________________________________
________
Choose the right car based on your needs.  Check out Yahoo! Autos new Car
Finder tool.
http://autos.yahoo.com/carfinder/

----------------------------------------------------------------------------
-
To unsubscribe, send email to [EMAIL PROTECTED]
----------------------------------------------------------------------------
-




-----------------------------------------------------------------------------
To unsubscribe, send email to [EMAIL PROTECTED]
-----------------------------------------------------------------------------

Reply via email to