Re: [sqlite] handling sqlite3_close() == SQLITE_BUSY

2010-06-23 Thread Pavel Ivanov
I'd better do it this way:        int rc = sqlite3_close(db);        if ( rc == SQLITE_BUSY)        {            // shouldn't happen in a good written application but let's handle it            sqlite3_stmt * stmt;           while ((stmt = sqlite3_next_stmt(db, NULL)) != NULL) {

[sqlite] handling sqlite3_close() == SQLITE_BUSY

2010-06-22 Thread Sam Carleton
On Tue, Jun 22, 2010 at 10:13 AM, Pavel Ivanov paiva...@gmail.com wrote: No, I did not. I am not storing any blobs right now, but... Is the busy handler going to kick in? I know the busy handler is not the sole answer to the problem, but it does seem to catch most of my SQLITE_BUSY

Re: [sqlite] handling sqlite3_close() == SQLITE_BUSY

2010-06-22 Thread Simon Slavin
On 22 Jun 2010, at 11:18pm, Sam Carleton wrote: void CSQLiteDB::Close() { if(m_db) { sqlite3 *db = m_db; m_db = NULL; Does not do what you are trying to do. Just use m_db. int rc = sqlite3_close(db); while( rc == SQLITE_BUSY) {