On Thu, Nov 29, 2012 at 12:04 PM, Simon Slavin <[email protected]> wrote:

> I have a folder with 17 independent databases in, each of them opened for
> reading an writing occasionally.  Two of them have both -wal and -shm
> files, even though they shouldn't have been opened for read or write for
> days, and the last opening of each one closed connections properly without
> crashing.
>
> Should these journal files exist even when nothing is open or has crashed
> ?  I thought that properly-closed connections deleted journal files for
> databases in WAL mode.
>

If everybody does sqlite3_close() then those files are deleted on the last
call to sqlite3_close().  If they are lingering, that indicates that
somebody didn't do their sqlite3_close().


>
> Is there some official method to delete them ?  I tried VACUUM on one and
> when the connection was closed the journal files were deleted, but I don't
> want to do that if their existence definitely indicates that my code is not
> closing those files correctly.
>

Simply running:  "sqlite3 whatever.db .tables" should be sufficient to
delete left-over -shm and -wal files.  If that doesn't work, it indicates
that some other process still has the database open.



>
> Simon.
> _______________________________________________
> sqlite-users mailing list
> [email protected]
> http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users
>



-- 
D. Richard Hipp
[email protected]
_______________________________________________
sqlite-users mailing list
[email protected]
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

Reply via email to