Replication+CBLLiveQuery too many Database Busy messages

46 views
Skip to first unread message

Frederic Yesid Peña Sánchez

unread,
Feb 27, 2014, 12:45:58 PM2/27/14
to mobile-c...@googlegroups.com
Hi.

We currently use a lot of CBLLiveQueries to keep several TableViews updated on multiple ViewControllers.

We are noticing frequent issues, when the app is open but idle (no user interaction), the replication starts and our logs show a lot of Database Busy messages.

Running 1.0beta2 for iOS

Frederic Yesid Peña Sánchez

unread,
Feb 27, 2014, 12:47:56 PM2/27/14
to mobile-c...@googlegroups.com
It's possible to enqueue all CBLLiveQuery and replication on the same serial dispatch queue??

Jens Alfke

unread,
Feb 27, 2014, 1:12:52 PM2/27/14
to mobile-c...@googlegroups.com

On Feb 27, 2014, at 9:45 AM, Frederic Yesid Peña Sánchez <freder...@gmail.com> wrote:

We are noticing frequent issues, when the app is open but idle (no user interaction), the replication starts and our logs show a lot of Database Busy messages.

Those messages mean you’re using CBL objects on multiple threads. Don’t do that! The API is not thread-safe and you’re likely to crash.

It's possible to enqueue all CBLLiveQuery and replication on the same serial dispatch queue??

Yes, but you have to first set the CBLManager’s dispatchQueue property to the queue you want to use it on, and then all access to the objects has to be from that queue.

There are instructions about concurrent access in the docs.

—Jens
Reply all
Reply to author
Forward
0 new messages