CoreData: Attr. uniqueness, Multithreading
CoreData: Attr. uniqueness, Multithreading
- Subject: CoreData: Attr. uniqueness, Multithreading
- From: Marc Monguio <email@hidden>
- Date: Mon, 14 Nov 2005 14:59:16 -0800
I'm new to CoreData. In my new application I'm using a sqlite db for
persistence. However, I'm experiencing some problems.
The first one is perfomance. I have one entity with a path attribute
which I want to be unique. To do so, before I add a new row into the
entity I fetch for that path in the database if there's not any I add
the new row with the path information. The firsts inserts are quite
fast but as long as the db increases it's size it's slower and
slower. I've tried to use the undocumented feature shown in this list
for indexing properties (_NSCreateIndex) but it works as slow as
before. Maybe is that I'm not doing in correctly, is it ?
NSDictionary *userInfo = [NSDictionary
dictionaryWithObjectsAndKeys:@"path", @"_NSCreateIndex", nil];
if ( [coordinator addPersistentStoreWithType:NSSQLiteStoreType
configuration:nil URL:url options:userInfo error:&error] ) {
(...)
The second problem I'm facing right now is that my application uses
one thread to populate the entity with paths and other information.
Meanwhile through the UI users can be able to add more stuff in the
entity. Everytime there's a fetch the applications throws an
exception saying:
An uncaught exception was raised
2005-11-14 12:52:58.162 Test[16594] _obtainOpenChannel -- NSSQLCore
0x4044750: no database channel is available
2005-11-14 12:52:58.163 Test[16594] *** Uncaught exception:
<NSInternalInconsistencyException> _obtainOpenChannel -- NSSQLCore
0x4044750: no database channel is available
any clue ?
Also, in order to have a thread save application I'm fetching and
inserting enclosed using lock and unlock methods, but seems that it
has nothing to do with that error because even if I comment those
lines throws the same exception.
thanks in advance,
Marc
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden