On 19 Mar 2015, at 11:48pm, Bart Smissaert <bart.smissaert at gmail.com> wrote:

> Is this all how it should be?

Apart from the following, nothing I see looks like it will cause problems.  You 
should be checking the result codes of all the calls you do to make sure you 
are getting SQLITE_OK (==0) returned from them and not an error.

> Where/when should I call sqlite3_close?

Once you know you don't need access to the database any more.  Before your 
application quits. As above, check to see that you are getting SQLITE_OK back 
to indicate that your connection to the database was still working correctly 
when you closed it.

> Does Clearbindings come indeed before finalize?

You do not need to clear bindings before _finalize(), since _finalize() 
releases all the bindings for you as part of releasing all resources used by 
the statement.

You might want to clear bindings before or after a _reset(), since it can help 
you to find errors when you start binding for the next use of the statement.

Simon.

Reply via email to