It causes a lot af wierd behaviour when I use APPSQL or Session's Sql object and changing databases while the app is running.
It reads some data from the previously opened database. It is not so good.
So I suggest something like this:
void Sqlite3Session::Close() {
sql.Clear();
if (NULL != db) {
+ SessionClose();
int retval;
#ifndef flagNOAPPSQL
if(SQL.IsOpen() && &SQL.GetSession() == this)