Nov 19, 2009, at 12:13 PM, Jay A. Kreibich wrote:

On Thu, Nov 19, 2009 at 11:58:59AM -0900, Israel Brewster scratched on the wall:

When issuing an INSERT command on a SQLite database, is that insert
cached before being written to the disk?

 Sometimes.  It may be partly cached until the transaction is
 committed.  If it is a stand-alone INSERT, that will be as soon as
 the statement is fully processed.

If so (as I suspect to be the
case), is there a way to force the cache to be flushed to disk?

 Commit any open transactions.

I have
an application that issues a number of INSERT statements, but these
don't appear to be written to the actual database file until the
application quits.

 If you're using the C API, make sure you call sqlite3_reset() and/or
 sqlite3_finalize() to close out the statement.

Thanks for the info. I'm not using transactions, so that shouldn't be the problem. I'm using the Qt SQL drivers, but they just use the C API's in a fairly standard way, to my understanding. I'll look more into that then. Thanks!


  -j

--
Jay A. Kreibich < J A Y  @  K R E I B I.C H >

"Our opponent is an alien starship packed with atomic bombs.  We have
a protractor."   "I'll go home and see if I can scrounge up a ruler
and a piece of string."  --from Anathem by Neal Stephenson
_______________________________________________
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

-----------------------------------------------
Israel Brewster
Computer Support Technician II
Frontier Flying Service Inc.
5245 Airport Industrial Rd
Fairbanks, AK 99709
(907) 450-7250 x293
-----------------------------------------------



_______________________________________________
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

Reply via email to