Difference between FMDB.database.beginTransaction and FMDB.databaseQueue.inTransaction
CODE A
FMDBDatabase *db = xxxxx
[db beginTransaction];
[db executeUpdate:xxxx];
xxxxxxx
CODE B
FMDBDatabaseQueue *queue = xxxxx
[queue inTransaction:^{xxxxxx}]
What is the difference between database.beginTransaction and databaseQueue.inTransaction? Since I can see inTransaction just doing sql actions in the queue, but beginTransaction seems to be doing something at the sqlite level. Which one is the best choice for thread safety and what's the difference between them?
+3
source to share