RikH
RikH

Reputation: 3424

Disk I/O errors even after removing the file

I'm getting various errors when running tests on an SQLite database when I specify the database to be located at /tmp/a. Errors include SQLITE_IOERR_DELETE_NOENT (5898) and SQLITE_READONLY_DBMOVED (1032). These errors persist even after I remove the file /tmp/a. Strangely enough, if I specify the database to be located at /tmp/b, then everything works as expected. Also, noteworthy is that the errors at /tmp/a occur after database initialization, meaning that the database has been initialized with various tables; this implies that writing does work to a certain point. Also, file permissions look identical for both files:

$ ls -ahlv /tmp/a
-rw-r--r-- 1 rik users 24K Jan 15 18:00 /tmp/a

$ ls -ahlv /tmp/b
-rw-r--r-- 1 rik users 24K Jan 15 18:00 /tmp/b

Maybe this some issue with SSD caching? I'll keep an eye on it and update this post if new things happen.

Upvotes: 0

Views: 147

Answers (1)

davidriod
davidriod

Reputation: 1057

Your temporary file name may not be random enough to not have another rogue process interact with the same file. You may want either to use or more random file name to avoid conflict on the same file. Or if the file is really temporary you may want to use the :memory: file name which implies to not write anything on the disk and keep the full database in memory.

Upvotes: 1

Related Questions