At present I can't answer that. I can't reliably reproduce the problem (and never in the debugger) so I don't yet really know what the critical factor is.
What I'm trying to understand is what guarantees Sqlite makes. If we assume a perfectly valid sequence of SQL and API calls ending with COMMIT, followed immediately by a panic shutdown with no API calls to release any prepared statements, handles or whatever, is the data saved? If not, what is the minimum that must be done to ensure the data is written out and the database is valid? Is there a timing element? Are threads involved? Is nondeterministic behaviour possible? I think these are important things to understand for an embedded database, and I couldn't find much in the docs. Regards David M Bennett FACS Andl - A New Database Language - andl.org > -----Original Message----- > From: [email protected] [mailto:sqlite-users- > [email protected]] On Behalf Of Simon Slavin > Sent: Wednesday, 25 May 2016 10:46 AM > To: SQLite mailing list <[email protected]> > Subject: Re: [sqlite] What could be the cause of a zero length database file? > > Do you close the database connection properly when you're done with it ? > > Simon. > _______________________________________________ > sqlite-users mailing list > [email protected] > http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users _______________________________________________ sqlite-users mailing list [email protected] http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users

