In my guess, if you call following command after for each operation and
schema exits exactly... Your test may removes *-wal file.

conn.execute("PRAGMA wal_checkpoint;")

I hope it is correct answer.

Regards.

2016년 6월 3일 (금) 19:19, Максим Дементьев <deme...@hotmail.com>님이 작성:

> Hello,
>
> I’ve got a set of python 3 unittests which use sqlite (versions 3.12.0 and
> 3.13.0 under Linux 4.4.6-gentoo x86_64).
>
> There is one test which closes the database and opens it again during the
> test.
> If I use the WAL (by using conn.execute("PRAGMA journal_mode=WAL;")) and
> run all unittests, this unittest produces a database file with the empty
> schema after first close, so it fails.
> When I run it alone (or without WAL), it passes.
>
> I’ve checked “hexdump -C” of the normal and the bad cases after first
> close, in both cases the size of database file is the same, they contain
> common data for inserted rows, but there is no “CREATE TABLE ...”
> statements in the bad database file.
>
> There are conn.commit() calls after each modification SQL statement. I
> even tried to put explicit "BEGIN; ... COMMIT;" around "CREATE TABLE IF NOT
> EXISTS..." statements, it doesn't help.
>
> Is it a well-known problem ?
>
> Regards,
> Max
>
>
> _______________________________________________
> sqlite-users mailing list
> sqlite-users@mailinglists.sqlite.org
> http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users
>
_______________________________________________
sqlite-users mailing list
sqlite-users@mailinglists.sqlite.org
http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users

Reply via email to