On 07/10/2016 06:21 AM, Igor Korot wrote:
Simon,
On Sat, Jul 9, 2016 at 7:09 PM, Simon Slavin <slav...@bigfraud.org> wrote:
On 10 Jul 2016, at 12:06am, Igor Korot <ikoro...@gmail.com> wrote:
I'm trying to write some software in C{++}. Everything works fine except
when I exit the program exit I get the error "Database is locked".
I am only trying to retrieve the information about the database (queries on
sqlite_master).
What command are you executing when you get "Database is locked" in return ?
sqlite3_close();
Have you terminated your query properly ? Did you call sqlite_finalize() on it
? Did you get SQLITE_OK back from that call ?
Yes, everything is finalized. And no error on finalization is produced.
That's why I'm asking if there is a tool that can check what is open.
As I think you have surmised, you most likely have an unfinalized
statement handle hanging around somewhere. After sqlite3_close() fails,
use this:
https://www.sqlite.org/c3ref/next_stmt.html
to loop through any unfinalized statement handles. If you find such a
handle, this:
https://www.sqlite.org/c3ref/sql.html
can be useful for figuring out where it came from.
Dan.
_______________________________________________
sqlite-users mailing list
sqlite-users@mailinglists.sqlite.org
http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users