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 12:56:27 -0700
- Organization: Global Village Consulting, Inc.
Hi Kaj,
First off,
> 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?
Chuck
Kaj Hejer wrote:
Hei!
In the method bellow from a EO object
public NSArray getPasienterWithPrefetch() {
NSArray args = new NSArray(new Object[] { this });
EOQualifier qual =
EOQualifier.qualifierWithQualifierFormat("arkivinstans = %@",
args);
EOFetchSpecification fs =
new EOFetchSpecification("Pasient", qual, null);
NSMutableArray prefetchPaths = new NSMutableArray();
prefetchPaths.addObject("kasus");
prefetchPaths.addObject("hovedkasus");
prefetchPaths.addObject("kjonn");
fs.setPrefetchingRelationshipKeyPaths(prefetchPaths);
return editingContext().objectsWithFetchSpecification(fs);
}
objectsWithFetchSpecification gives the exception I include bellow. The
object on which I call this method is insterted in
session.defaultEditingContext().
How is it possible to get this exception when I don't refere to any
other objects, but only use this and editingContext()?
I also get a bit confused about what "databaseContext's active
editingContext" mean. This is clearly different from the editingContext
of the object on which I call this method.
I think there is something important missing from my WOKnowledge here.
Here is the exception:
Cannot obtain globalId for an object which is registered in an other
than the databaseContext's active editingContext, object: {values =
[removed some debuginfo]
this = "<Arkivinstans 26154b _EOIntegralKeyGlobalID[Arkivinstans
(java.lang.Integer)1]>"; }, databaseContext:
com.webobjects.eoaccess.EODatabaseContext@2613f8, object's
editingContext: com.webobjects.eocontrol.EOEditingContext@76c074,
databaseContext's active editingContext:
com.webobjects.eocontrol.EOEditingContext@1b9a30
at
com.webobjects.eoaccess.EODatabaseContext._globalIDForObject(EODatabaseContext.java:4677)
at
com.webobjects.eoaccess.EODatabaseContext.databaseOperationForObject(EODatabaseContext.java:4780)
at
com.webobjects.eoaccess.EODatabaseContext.valuesForKeys(EODatabaseContext.java:6483)
at
com.webobjects.eocontrol.EOObjectStoreCoordinator.valuesForKeys(EOObjectStoreCoordinator.java:316)
at
com.webobjects.eoaccess.EOQualifierSQLGeneration$_KeyValueQualifierSupport.schemaBasedQualifierWithRootEntity(EOQualifierSQLGeneration.java:381)
at
com.webobjects.eoaccess.EOQualifierSQLGeneration$Support._schemaBasedQualifierWithRootEntity(EOQualifierSQLGeneration.java:132)
at
com.webobjects.eoaccess.EODatabaseChannel.selectObjectsWithFetchSpecification(EODatabaseChannel.java:212)
at
com.webobjects.eoaccess.EODatabaseContext._objectsWithFetchSpecificationEditingContext(EODatabaseContext.java:3007)
at
com.webobjects.eoaccess.EODatabaseContext.objectsWithFetchSpecification(EODatabaseContext.java:3148)
at
com.webobjects.eocontrol.EOObjectStoreCoordinator.objectsWithFetchSpecification(EOObjectStoreCoordinator.java:472)
at
com.webobjects.eocontrol.EOEditingContext.objectsWithFetchSpecification(EOEditingContext.java:3356)
at
com.webobjects.eocontrol.EOEditingContext.objectsWithFetchSpecification(EOEditingContext.java:3686)
at Arkivinstans.getPasienterWithPrefetch(Unknown Source)
at Arkivinstans.getSynligePasienter(Unknown Source)
at Navigation.shouldShowPasientRapportLink(Unknown Source)
at java.lang.reflect.Method.invoke(Native Method)
at
-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.
--
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.