> On Jan 2, 2017, at 6:28 PM, Domonic Tom <abdom...@hotmail.com> wrote:
> 
> Is there a way to test whether the DB_handle used when opening a database is 
> good?
> I need to find some way of testing it to make sure it represents the live 
> connection to a database?

“DB_handle” isn’t a term used in the SQLite C API. If you’re using a different 
(wrapper) API, you need to state which one you’re using, because the answer may 
depend on it.

In the C API, after you’ve closed a connection, the `sqlite3*` pointer used as 
the database handle is garbage — it points to deallocated/freed heap memory. 
There’s no way to tell whether a heap block has been freed or not*. So the 
answer to your question is probably “no”.

—Jens

* not without groping into data structures private to the implementation of 
malloc/free...
_______________________________________________
sqlite-users mailing list
sqlite-users@mailinglists.sqlite.org
http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users

Reply via email to