diff --git a/lib/sqlite3db.cpp b/lib/sqlite3db.cpp index 75c315e86..7dee44aaa 100644 --- a/lib/sqlite3db.cpp +++ b/lib/sqlite3db.cpp @@ -764,7 +764,13 @@ void SQLite3_result::add_column_definition(int a, const char *b) { * @return An integer representing the result of the operation (SQLITE_ROW on success). */ int SQLite3_result::add_row(sqlite3_stmt *stmt, bool skip) { - int rc=(*proxy_sqlite3_step)(stmt); + int rc = 0; + do { + rc = (*proxy_sqlite3_step)(stmt); + if (rc == SQLITE_BUSY || rc == SQLITE_LOCKED) { + usleep(USLEEP_SQLITE_LOCKED); + } + } while (rc == SQLITE_BUSY || rc == SQLITE_LOCKED); if (rc!=SQLITE_ROW) return rc; if (skip==false) { SQLite3_row *row=new SQLite3_row(columns);