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: Chuck Hill <email@hidden>
- Date: Tue, 10 Jun 2003 13:53:22 -0700
- Organization: Global Village Consulting, Inc.
Kaj Hejer wrote:
At 12:56 -0700 10-06-2003, Chuck Hill wrote:
I also get a bit confused about what "databaseContext's active
editingContext" mean.
When an EC starts to do anything outside of its sandbox (fetching and
saving), it locks the database context(s) that it is using. Only one
EC can lock a database context at a time. When an EC locks a database
context that EC becomes the database context's active editing context.
Is it possible that this has been related, in code, to an Pasient in a
different editing context?
Now I have done some digging! :)
It seems like this problem started after we for some reason got a
nullpointer exception while editing, and after that every time we call
the getPasienterWithPrefetch method the databaseContext's active
editingContext is the same.
Could you post the fill stack trace? I think the first think to do is
to try and avoid this error.
Here is the output from three different calls to this method:
com.webobjects.eoaccess.EODatabaseContext@2613f8, object's
editingContext: com.webobjects.eocontrol.EOEditingContext@6f2b35,
databaseContext's active editingContext:
com.webobjects.eocontrol.EOEditingContext@1b9a30
com.webobjects.eoaccess.EODatabaseContext@2613f8, object's
editingContext: com.webobjects.eocontrol.EOEditingContext@55a27,
databaseContext's active
editingContext: com.webobjects.eocontrol.EOEditingContext@1b9a30
com.webobjects.eoaccess.EODatabaseContext@2613f8, object's
editingContext: com.webobjects.eocontrol.EOEditingContext@312262,
databaseContext's active editingContext:
com.webobjects.eocontrol.EOEditingContext@1b9a30
The object's editingContext differ since that is
session.defaultEditingContext, but the databaseContext's active
editingContext is the same and i guess that is because of the locking
you describe.
That looks like a bug in EOF to me. The stack trace (from above)
would help to verify this. It looks like the exception is preventing
the EC from removing its lock on the DB context. I'd expect very
little in your application to work after this happens.
The more I learn, the more questions I got ;-)
:-)
Now I wonder how I can release the database context's active editing
context, and what is the best way of handling this type of issues. I
guess it should be handled when we get the excepion from saveChanges
that seems to have triggered this whole thing.
The best way to handle this is to fix whatever is causing that
exception. Once the exception has happened I don't know what you can
do to unlock the DB context. You could try calling dispose() on the EC.
Is there anything in the WO domnentation somewhere about what you write
about database context's active editing context? Just curious. If it's
not, I mayme should file a enhancement report at bugreport.apple.com.
I'm not aware of any such documentation (that does not mean it does
not exist!). I pretty much made that up off the top of my head based
on experience with this exception.
Chuck
--
Chuck Hill email@hidden
Global Village Consulting Inc. http://www.global-village.net
Progress is the mother of all problems.
- G. K. Chesterton
_______________________________________________
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.