forcedotcom/SalesforceMobileSDK-iOS — pull request #568 by wmathurin (2014-05-09 19:18:09+00:00)
Title: Using FMDatabaseQueue in SmartStore to make it thread safe

Overview:
SFSmartStore has a FMDatabaseQueue instance instead of a FMDatabase instance.
Public methods like registerSoup, retrieveEntries etc, do something like:
[self.storeQueue inDatabase/inTransaction:^(FMDatabase db) { }];
And have a private method with the same signature and an additinonal parameter withDb:(FMDatabase*)db.
The methods "withDb" should only call other methods "withDb". If they call a public method, the thread will lock up.

Notes:
I am still investigating 3 failures in SFSmartStoreTests (in encryption related tests). I hope to checkin a fix before merging this pull request.

Next:
After the pull request, I want to bring caching/error handling closer to what we do on Android (but it could be 2.3 work).