Ping: Look for hints for "nested transaction" problem with Core Data
Ping: Look for hints for "nested transaction" problem with Core Data
- Subject: Ping: Look for hints for "nested transaction" problem with Core Data
- From: Pierre Chatelier <email@hidden>
- Date: Thu, 15 Mar 2007 11:09:41 +0100
It's seems that my message did not start a very long thread ;-)
I am worried it is being buried by new messages, so I just try once
more. By the way, isn't there a mailing list more CoreData centric ?
Hello,
I have a bug in an application of mine, that I can' manage to get rid
of. This bug is related to Core Data.
In my application, I use Core Data (in a very straightforward way),
and I regularly save the NSManagedObjectContext. Sometimes, when
calling the save method of the context, an exception is raised
telling "nested transactions are not supported" (or "nested
transactions are not allowed", I just can't remember at this time). I
have found very few documentation about that on sqllite.
My first question is : when does this arrive with Core Data ?
My second question would be : what should I check to fix it ?
Here are some details about my use of Core Data.
-I have a persistent store in sqllite format, storing many objects,
which are not subclasses (just NSManagedObjects)
-my application fetchs some objects from the store, and store them in
a NSDictionary for fast access. It usually does not load the whole
store, only a part of it.
-I update those NSManagedObjects with common KVO. This is in a multi-
thread context
-I regularly save the context to keep the changes made to the objects
in a a background thread
-Don't worry, I do use my own NSLocks and the lock/unlock methods of
NSManagedObjectContext, and I am pretty sure I use them well (not
newbie). (It's even possible that I use them too much because of my
experiments to fix the bug of nested transactions, but there is no
interlocking).
-I took great care of proper memory management, and I think that my
code using CoreData has no memory leaks or possible segmentation
faults (no crashes and no leaks according to the "leaks" tool)
I had an idea that may be totally wrong : perhaps that after a few
time (even if I did not touch the staleness),and after I have updated
them, the objects of my context are set to a fault and then, when
saving, CoreData must fire the faults before saving. So I tried,
just before saving, to make somme dummy KVO calls to fetch the fault
myself, and call refreshObjects:mergeChanges:NO. It seems not to be
sufficient.
Can anyone add some thoughts to help me find out what happens ?
Thanks in advance,
Pierre Chatelier
_______________________________________________
Cocoa-dev mailing list (email@hidden)
Do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden