No no actually we are accessing the models on the thread it was created 
only.. But the scenario is , consider i have xyz model , in one thread i am 
trying to fetch xyz model from database for UI display and in other thread 
parsing is happening and trying to save xyz model at the same time(both 
using different database pointers and threads only).

Exception we got,
 <Error>: *** Terminating app due to uncaught exception '
NSInternalInconsistencyException', reason: 'Document already has a model


On Friday, August 8, 2014 5:36:28 AM UTC+5:30, Jens Alfke wrote:
>
>
> On Aug 7, 2014, at 3:48 AM, rupa selvaraj <[email protected] <javascript:>> 
> wrote:
>
> Currently, based on the number of files, we will detach separate thread 
> with separate database pointer (using cblmanager copy) for file 
> parsing.That is working fine.But the app is crashing when we try to use the 
> same model, for UI loading  and for parsing and saving models at the same 
> time but using different threads and pointers only.
>
>
> You can't use a CBLModel on a different thread than the one it was created 
> on. (Just like all the other CBL objects.)
>
> Parsing also takes sometime.For 5 jsons files,each of size 700kb to 1Mb 
> takes 5 to 10 seconds.
>
>
> That's about what I'd expect. I've spent some time looking at JSON parsing 
> performance; a lot of it isn't in the actual parsing but in allocating all 
> of the objects. If you're only going to be using part of the data in the 
> documents, you can speed up the parsing by using a streaming library that 
> doesn't create objects for everything. I like jsonsl 
> <http://github.com/mnunberg/jsonsl>.
>
> —Jens
>

-- 
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/29c82530-8ef2-47fb-b0b7-04b192a02132%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to