Commit 68558ef8 by Hugo Beauzée-Luyssen

SqliteConnection: Add a busy timeout

This aims at working around sporadic "database is locked" // SQLITE_BUSY
errors on android
parent 4d6eddac
......@@ -60,6 +60,7 @@ SqliteConnection::Handle SqliteConnection::getConn()
throw sqlite::errors::Generic( std::string( "Failed to connect to database: " )
+ sqlite3_errstr( res ) );
sqlite3_extended_result_codes( dbConnection, 1 );
sqlite3_busy_timeout( dbConnection, 500 );
sqlite::Statement s( dbConnection, "PRAGMA foreign_keys = ON" );
s.execute();
while ( s.row() != nullptr )
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment