Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Database locking behavior differing on Mac vs iOS. #256

Open
vlozko opened this issue Oct 18, 2016 · 1 comment
Open

Database locking behavior differing on Mac vs iOS. #256

vlozko opened this issue Oct 18, 2016 · 1 comment

Comments

@vlozko
Copy link

vlozko commented Oct 18, 2016

I took Apple's earthquake sample app and created both a macOS and iOS version of it. The Core Data components stayed the same between the two (other than DB path). I've tried the following scenarios:

  1. Use iOS and macOS app with NSSQLStoreType - No issues.
  2. Use macOS app with EncryptedStoreType and sqlcipher - No issues.
  3. Use iOS app with EncryptedStoreType with sqlcipher - (see below)
  4. Use iOS app with EncryptedStoreType with iOS's libsql3 static lib and set/change database passphrase stuff commented out and return YES - (see below)

In the iOS cases using encrypted store, I'm frequently getting error messages indicating that the database is locked. It appears to be set in the unixLock function (sqlite3.c:30873 on my side). The project itself does use two different persistent store coordinators for the same database file, though this doesn't appear to be an issue on macOS. I've attached both the iOS and macOS project that demonstrate this difference.
EarthquakesIOS.zip
EarthquakesMACOS.zip

@AKoulabukhov
Copy link

You can use SQLite Pragmas ["journal_mode": "WAL", "busy_timeout": "60000"] to get rid of this error. But current version of ECD not supports NSSQLitePragmasOption in parameters, so u need to fork it and use one of the variants of code update from #212 and all will be ok.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants