Re: "Cannot obtain globalId for an object which..."
Re: "Cannot obtain globalId for an object which..."
- Subject: Re: "Cannot obtain globalId for an object which..."
- From: Kaj Hejer <email@hidden>
- Date: Sat, 15 Nov 2003 20:23:21 +0100
At 09:49 -0800 15-11-03, Chuck Hill wrote:
Looking at your code:
args = new NSArray(new Object[] { this });
EOQualifier inviterteQual =
EOQualifier.qualifierWithQualifierFormat("invitertePersoner = %@", args);
fs = new EOFetchSpecification("Skjema", inviterteQual, null);
NSArray skjemaerInvitert = editingContext().objectsWithFetchSpecification(fs);
I can't see how 'this' could possibly NOT be in 'editingContext()'. This
isn't the notification problem that I originally thought. That trace from
that code looks like an EOF bug, at least after the single cup of coffee
I've had so far. :-)
Are you using the shared editing context? Are you accessing the
EODatabaseContext directly anywhere? Are any other exceptions raised
before this? I'm just wondering if something else is using the
EODatabaseContext without locking it, or has somehow left it in a dirty state.
Hi!
Thank you for answering and for looking at my code! :)
We don't use sharedEditingContext. In the constructor in Session.java we have
defaultEditingContext().setSharedEditingContext(null);
I have now browsed through the logs for this application again. I
have found a few more of the same "Cannot obtain globalId..."
exceptions.
Before some of them I see a "access with no lock" warning which we
get because we use the following code:
NSLog.setAllowedDebugLevel(NSLog.DebugLevelInformational);
NSLog.allowDebugLoggingForGroups(NSLog.DebugGroupMultithreading);
setAllowsConcurrentRequestHandling(true);
This was the case for the one I included in my previous email. Why I
get the "access with no lock" is another matter. That might be a bug
in my code. I will try to find the reason for these warnings.
I have pasted our childEC and locking related code into
http://folk.uio.no/kajh/tmp/locking-20031115.txt
We only use session.defaultEditingContext and a childEC of this with
only one exception: In one of our components which do a query that
take a while (the component is a WOLongResponsepage) we create a new
EOObjectStoreCoordinator so we don't block the database access for
the rest of the app. We use the following code for this:
LockErrorScreamerEditingContext editingContext =
new LockErrorScreamerEditingContext(new EOObjectStoreCoordinator());
Since all objectStoreCoordinators share the same EODatabaseContext
maybe this component can create some trouble that might lead to the
"Cannot obtain globalId..." exception both for the session where this
trouble happends and for other sessions.
One of the other methods (other that one in
http://folk.uio.no/kajh/tmp/bug20031114.txt) that sometimes give the
Cannot obtain globalId..." exception is the following:
public boolean hasRedaksjoner() {
return (getRedaksjoner() != null && getRedaksjoner().count() > 0);
}
and getRedaksjoner() looks as follows:
public NSArray getRedaksjoner() {
return (NSArray) storedValueForKey("redaksjoner");
}
The stacktrace is available at http://folk.uio.no/kajh/tmp/bug20031114-2.txt
The day before this exception I see a "access with no lock" warning
in the log, so maybe after that warning the EODatabaseContext is
left in a dirty state?
-Kaj :)
_______________________________________________
webobjects-dev mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/webobjects-dev
Do not post admin requests to the list. They will be ignored.