vendredi 4 décembre 2015

FMDBQueue and database is locked issue

I've been having this issue with FMDBQueue dispatch_sync(_queue) queue as it is not respecting the FIFO order that is supposed to be having and allowing a write from a different thread, to have a lock on the database while a another write, from another different thread, will be getting the "Database is locked" error.

Example:

Thread 23: executeUpdate() ==> (FMDBDatabaseBusyHandler) Thread 19: executeUpdate() ==> (Can't access the database because it is locked)

I am using FMDB user version 2.5 and I am using inDatabase to run the block of the SQL needed to be executed.

So I am wondering why the serial queue of FMDBQueue is not allowing Thread 23 to finish then allow Thread 19 to finish next. I am not sure if this is an issue with the implementation.

Aucun commentaire:

Enregistrer un commentaire