Re: CoreData - sqlite - statement is still active
Re: CoreData - sqlite - statement is still active
- Subject: Re: CoreData - sqlite - statement is still active
- From: Terrence Talbot <email@hidden>
- Date: Thu, 6 Oct 2005 12:03:02 -0700
On Oct 6, 2005, at 10:32 AM, Bill Bumgarner wrote:
Some questions....
- are you using threads? ... properly?
- do you diddle the sqlite database from outside of Core Data?
No, that's the thing: this should be a very straightforward exercise.
Single document, single context, single thread. The only diddling
I've done is a .dump (and now some selects, see below) of the
document on the command-line to make sure the rows for these objects
are there. They are...
????
FWIW, here's an additional path that sometimes results from
essentially the same set of requests. (That's the other tough thing:
it seems like the "statement is still active" issue can catch
CoreData at a couple of different points.)
Backtrace:
sqlite3VdbeExec
sqlite3VdbeExec
[NSSQLiteConnection _execute]
[NSSQLiteConnection execute]
[NSSQLChannel selectRowsWithFetchRequest:]
[NSSQLCore _newRowsForFetchRequest:]
[NSSQLCore objectsForFetchRequest:inContext:]
[NSSQLCore executeRequest:withContext:]
[NSPersistentStoreCoordinator(_NSInternalMethods)
executeRequest:withContext:]
[NSManagedObjectContext executeFetchRequest:error:]
Console:
[snip] fetching media with name Aqua
[snip] executing fetch: <NSFetchRequest: 0xd5ae550> (entity: Media;
predicate: (name LIKE "Aqua"); sortDescriptors: (null); limit: 0)
[snip] fetched a single object
[snip] successfully fetched media with name Aqua
[snip] asking for media data with specifier: 151
[snip] executing fetch: <NSFetchRequest: 0xd5b44c0> (entity: Media;
predicate: (uniqueID LIKE "151"); sortDescriptors: (null); limit: 0)
[snip] fetching media with name Cathedral
[snip] executing fetch: <NSFetchRequest: 0xd5bbea0> (entity: Media;
predicate: (name LIKE "Cathedral"); sortDescriptors: (null); limit: 0)
[snip] fetched a single object
[snip] media Aqua /Volumes/dwood/dev/biophony/trunk/KareliaSite/
Results of the Design Survey.rtfd/Aqua.png
[snip] Uncaught exception - statement is still active
[snip] *** Attempt to remove unrecognized exception handler 0xbfffd094
[snip] fetching media with name Branching_Out
[snip] executing fetch: <NSFetchRequest: 0xd5b6820> (entity: Media;
predicate: (name LIKE "Branching_Out"); sortDescriptors: (null);
limit: 0)
[snip] fetched a single object
[snip] successfully fetched media with name Branching_Out
[snip] asking for media data with specifier: 155
[snip] executing fetch: <NSFetchRequest: 0xd5bed80> (entity: Media;
predicate: (uniqueID LIKE "155"); sortDescriptors: (null); limit: 0)
[snip] fetching media with name Trippy
[snip] executing fetch: <NSFetchRequest: 0xd5bd6e0> (entity: Media;
predicate: (name LIKE "Trippy"); sortDescriptors: (null); limit: 0)
[Switching to process 17364 thread 0x740b]
Program received signal: "EXC_BAD_ACCESS".
[Switching to process 17364 thread 0x740b]
Printing description of fetchRequest:
<NSFetchRequest: 0xd5bed80> (entity: Media; predicate: (uniqueID LIKE
"155"); sortDescriptors: (null); limit: 0)
---------------
Note that it starts a fetch for (name LIKE "Trippy") and crashes but
that a 'po fetchRequest' shows that it's still stuck on (uniqueID
LIKE "155"). (uniqueID is stored as a String)
Also note that name Branching_Out and uniqueID 155 are the same
object. From the .dump:
INSERT INTO "ZMEDIA" VALUES(9, 12, 1, NULL, 'public.png',
'685a2a459396c553d3c40dad8f0df19848546f45', 11, 145227248, NULL,
'Branching_Out', '155', '/Volumes/dwood/dev/biophony/trunk/
KareliaSite/Results of the Design Survey.rtfd/Branching Out.png', 10,
NULL, NULL, 47);
sqlite> select * from ZMEDIA where ZUNIQUEID like '155';
9|12|1||public.png|685a2a459396c553d3c40dad8f0df19848546f45|11|
145227248||Branching_Out|155|/Volumes/dwood/dev/biophony/trunk/
KareliaSite/Results of the Design Survey.rtfd/Branching Out.png|10|||47
sqlite> select * from ZMEDIA where ZNAME like 'Branching_Out';
9|12|1||public.png|685a2a459396c553d3c40dad8f0df19848546f45|11|
145227248||Branching_Out|155|/Volumes/dwood/dev/biophony/trunk/
KareliaSite/Results of the Design Survey.rtfd/Branching Out.png|10|||47
Ah, but 'Trippy' actually doesn't exist! It's real name is
'Trippy_Tint'. My code first tries Trippy and then will try
Trippy_Tint. (Part of an internal URL protocol parser.) It's fine
with getting nil back for Trippy. But is CoreData ok with it?
sqlite> select * from ZMEDIA where ZNAME like 'Trippy';
sqlite>
sqlite> select * from ZMEDIA where ZNAME like 'Trippy_Tints';
9|8|1||public.png|8c4dfa8dc19ae08543c7e588b551afb9d0eeb417|11|
145227248||Trippy_Tints|157|/Volumes/dwood/dev/biophony/trunk/
KareliaSite/Results of the Design Survey.rtfd/Trippy Tints.png|11|||41
Although the "statement is still active" happens a bit before that,
on either Aqua or Cathedral which do exist.
sqlite> select * from ZMEDIA where ZNAME like 'Cathedral';
9|11|1||public.png|920d40982ab19ff5219345c2ab209d1cd315b89a|11|
145227248||Cathedral|153|/Volumes/dwood/dev/biophony/trunk/
KareliaSite/Results of the Design Survey.rtfd/Cathedral.png|9|||42
sqlite> select * from ZMEDIA where ZNAME like 'Aqua';
9|10|1||public.png|3e152c30b6b5cea6ceda8a6b0fcd4b9dfc6d450d|11|
145227248||Aqua|151|/Volumes/dwood/dev/biophony/trunk/KareliaSite/
Results of the Design Survey.rtfd/Aqua.png|14|||49
Any ideas?
_______________________________________________
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