> On Nov 21, 2016, at 12:39 PM, Richard Hipp <d...@sqlite.org> wrote:
> 
> On 11/21/16, Jens Alfke <j...@mooseyard.com> wrote:
>> Does SQLite ever open or create files while a database connection is already
>> open?
> 
> (1) When you run ATTACH.
> 
> (2) The open/create of the original database is deferred until you
> actually need to read or write the database, so the open/create might
> occur later than you expect.
> 
> (3) Some complex queries involve the use of temporary files, unless
> you set PRAGMA temp_store=MEMORY or use equivalent compile-time
> options.

I just ran into a situation that doesn’t seem to fall into any of those 
categories. This is an iPhone app running in the background, after the OS (iOS 
10.1) has locked its file access so it can only use existing file descriptors 
(but can’t open/create/delete files.) The app continues running for over two 
minutes, querying and inserting to the database, then fails:

2016-11-22 13:00:35.229777  Filesystem access lost
...
2016-11-22 13:02:46.361583  Unknown error calling sqlite3_step (14: unable to 
open database file)
2016-11-22 13:02:46.361844  DB Query: INSERT INTO revs (doc_id, revid, parent, 
current, deleted, no_attachments, json, doc_type) VALUES (?, ?, ?, ?, ?, ?, ?, 
?)

I did not close the database handle, so if SQLite is trying to open the file at 
this moment, it must have closed it earlier on its own.
Or could it be the WAL file? Does SQLite ever close and reopen, or delete and 
re-create, the WAL?

—Jens
_______________________________________________
sqlite-users mailing list
sqlite-users@mailinglists.sqlite.org
http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users

Reply via email to