Nevermind, it seems I have found the cause, I was doing: sqlthread->exec("PRAGMA synchronous = 0;",NULL,NULL); sqlthread->exec("PRAGMA cache_size = 4000;",NULL,NULL);
but changing it to this has sorted the problem out: sqlthread->exec("PRAGMA cache_size = 4000;",NULL,NULL); sqlthread->exec("PRAGMA synchronous = 0;",NULL,NULL); It seems the value of synchronous gets changed back to full if you change the cache_size.