No, this is not good. The documentation I linked you to, more 
specifically 
http://docs.couchbase.com/couchbase-lite/cbl-ios/#create-a-background-cblmanager
 
, mentions that you should NOT call `sharedInstance` on a background 
thread. Use the example provided and see if that works for you.

On Sunday, May 18, 2014 9:33:54 AM UTC-4, Ragu Vijaykumar wrote:
>
> So, this is safe to call even if all my models were created / accessed on 
> the main thread?
>
>     dispatch_async(dispatch_get_global_queue(
> DISPATCH_QUEUE_PRIORITY_BACKGROUND, 0), ^{
>
>         NSError* error;
>
>         CBLDatabase* database = [[[CBLManager sharedInstance] copy] 
> existingDatabaseNamed:@"mydatabase" error:&error];
>
>         [database saveAllModels:&error];
>
>     });
>

-- 
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 [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/mobile-couchbase/a1bbb906-f058-443e-a94e-2f05cea8197b%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to