jack wu <[EMAIL PROTECTED]> wrote: > do we usually do: > > open db->some operation with db->close db. > > or keep the db handle with the thread and use it all > the time? > > i am asking this mainly because of possible error > conditions. when an error happens, is it better to > close the database and reopen it later? i am going to > lock the handle with a global mutex, so thread safety > is not a concern, but who knows what kind of error > could occur. i would like to handle the error nicely > and still be able to use the database. so i thought > maybe always close the database is better? >
The database schema must be read and parsed with each sqlite3_open(). So the cost of an sqlite3_open() is proportional to the size of your schema. -- D. Richard Hipp <[EMAIL PROTECTED]>

