My ios application use FMDB framework to work with SQLite database. For updating database from server I use FMDatabaseQueue:
- (BOOL)executeUpdate:(NSString *)update
{
FMDatabaseQueue *dbQueue = [FMDatabaseQueue databaseQueueWithPath:databasePath];
__block BOOL success = NO;
[dbQueue inTransaction:^(FMDatabase *db, BOOL *rollback) {
success = [db executeUpdate: update];
}];
return success;
}
This approach allow me use multiple threads for working with database. But queries will be executed in the order they are received. When I update the big piece of data in database other queries(like getting some data for UI thread) must wait too long. Is there a way to allow other queries read commited data while updating is in progress?(Like JDBC Isolation level TRANSACTION_READ_COMMITTED)