Experimental SQLite database-busy fix (iOS)

108 views
Skip to first unread message

Jens Alfke

unread,
Sep 15, 2014, 7:27:51 PM9/15/14
to mobile-c...@googlegroups.com
I've got an experimental solution to the problem of database-busy errors/warnings in Couchbase Lite on iOS/Mac. It uses an in-memory lock to coordinate access to the database between threads, instead of SQLite's default behavior of using file locking. It works for me in unit tests, but I'd like for some people to try it out in real apps that have had database-busy problems.

It's currently checked in on the feature/sqlite_locking branch. There are no API changes nor anything you need to do differently. There should just be less contention between multiple threads accessing the database (including the replicator and LiveQueries.) Please let me know whether it helps, or if you run into any problems.

—Jens

Mark

unread,
Sep 16, 2014, 7:54:09 PM9/16/14
to mobile-c...@googlegroups.com
Hi Jens,

I tested this on my test app. It solves all of the contention issues I had under the most load my system can drum up, including replication in and out, live queries, and sub-second document/model creation and insert. I haven't run a full test suite, but initial results look good. Thanks!
> --
> You received this message because you are subscribed to the Google Groups "Couchbase Mobile" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to mobile-couchba...@googlegroups.com.
> To view this discussion on the web visit https://groups.google.com/d/msgid/mobile-couchbase/AB8FBC8A-E766-4457-B648-42581DECE460%40couchbase.com.
> For more options, visit https://groups.google.com/d/optout.

Jens Alfke

unread,
Sep 18, 2014, 6:14:49 PM9/18/14
to mobile-c...@googlegroups.com
Thanks for the confirmation, Mark.

I've gone ahead and merged this change into the master branch, so it can go through our QA process for the next release.

—Jens
Reply all
Reply to author
Forward
0 new messages