Roger Gullhaug wrote:
Hi,

I'm writing an application that writes to SQLite at least once per
second. Is it wise to close the connection between each SQL call or is
it better to leave the connection open while the program is running?
This is a server application that will run for days and hopefully weeks
and months... There is another process which reads from this SQLite db.


Leave it open, and better still use sqlite3_prepare to compile the SQL just once, then use sqlite3_reset between calls. You then avoid the overhead of opening and closing the database and of compiling the same SQL every second.

Reply via email to