Before answering my questions:

Please get rid of "rename" entirely in my post. Replace "rename/move" with just 
"move".

Also, assume that whenever I move my main database file, the -journal file 
always moves with it too.

I apologize for the confusion. My mistake. Sorry Richard.

> I have made a few experimental observations and I would appreciate your 
> thoughts.
>
> 1.
>
> _open() does indeed actually open the main database file. It is left open all 
> the way until _close(), when it is actually closed. Correct?
>
> I ask because someone mentioned before that _open() doesn't really open the 
> file - that it only prepares the file for opening at a later time when open 
> is actually needed.
>
>
> 2.
>
> If my SQL statements do nothing but read from the database (no writes), I can 
> rename/move the main database file any time I wish after _open() without any 
> problems whatsoever. Correct?
>
>
> 3.
>
> If my SQL statements write to the database and I rename/move the main 
> database file just after _open(), the next call to _step() gives me the error 
> SQLITE_IOERR.
>
> This happens NOT because the main database file has been renamed/moved. 
> Correct?
>
> Rather, this happens because the old path has been saved by SQLite for use by 
> the -journal files. The error happens because SQLite cannot match the 
> -journal file name and the main database file name (which has now changed). 
> But here I'm just guessing. Is this correct? If not, then why exactly does 
> the error occur?                                     
_______________________________________________
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

Reply via email to