• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
ERXFetchSpecificationBatchIterator : Cannot obtain globalId for an object which is registered in an other than the databaseContext's active editingContext
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

ERXFetchSpecificationBatchIterator : Cannot obtain globalId for an object which is registered in an other than the databaseContext's active editingContext


  • Subject: ERXFetchSpecificationBatchIterator : Cannot obtain globalId for an object which is registered in an other than the databaseContext's active editingContext
  • From: Simon McLean <email@hidden>
  • Date: Mon, 2 Mar 2009 11:46:52 +0000

I've got a bizarre error that I'm struggling to debug. Wondering if anyone can give me a point in the right direction...?


I've got a pretty boring fetch spec, and if i call this:


NSArray batch = ec.objectsWithFetchSpecification(fs);


... i get an array of objects. No issue. But I've been working on improving the performance of this piece of code because sometimes the array can be huge. So, I decide to introduce my usual favorite ERXFetchSpecificationBatchIterator. However, when I call this (in place of the above):


ERXFetchSpecificationBatchIterator fsbi = new ERXFetchSpecificationBatchIterator(fs, ec);


I get an immediate exception:


java.lang.IllegalStateException: Cannot obtain globalId for an object which is registered in an other than the databaseContext's active editingContext, object: Stormking Ltd 70 er.extensions.eof.ERXEC@7e9482, databaseContext: er.extensions.eof.ERXDatabaseContext@d6db5b, object's editingContext: er.extensions.eof.ERXEC@7e9482, databaseContext's active editingContext: er.extensions.eof.ERXEC@748f91


The full stack trace is as follows, which hints that it's not liking generating the actual SQL needed for the fetch:


     at com.webobjects.eoaccess.EODatabaseContext._globalIDForObject(EODatabaseContext.java:4847) 
     at com.webobjects.eoaccess.EODatabaseContext.databaseOperationForObject(EODatabaseContext.java:4964) 
     at com.webobjects.eoaccess.EODatabaseContext.valuesForKeys(EODatabaseContext.java:6701) 
     at com.webobjects.eocontrol.EOObjectStoreCoordinator.valuesForKeys(EOObjectStoreCoordinator.java:341) 
     at com.webobjects.eoaccess.EOQualifierSQLGeneration$_KeyValueQualifierSupport.schemaBasedQualifierWithRootEntity(EOQualifierSQLGeneration.java:418) 
     at er.extensions.ERXExtensions$KeyValueQualifierSQLGenerationSupport.schemaBasedQualifierWithRootEntity(ERXExtensions.java:315) 
     at com.webobjects.eoaccess.EOQualifierSQLGeneration$Support._schemaBasedQualifierWithRootEntity(EOQualifierSQLGeneration.java:165) 
     at com.webobjects.eoaccess.EOQualifierSQLGeneration$_AndQualifierSupport.schemaBasedQualifierWithRootEntity(EOQualifierSQLGeneration.java:502) 
     at com.webobjects.eoaccess.EOQualifierSQLGeneration$Support._schemaBasedQualifierWithRootEntity(EOQualifierSQLGeneration.java:165) 
     at com.webobjects.eoaccess.EOQualifierSQLGeneration$_AndQualifierSupport.schemaBasedQualifierWithRootEntity(EOQualifierSQLGeneration.java:502) 
     at com.webobjects.eoaccess.EOQualifierSQLGeneration$Support._schemaBasedQualifierWithRootEntity(EOQualifierSQLGeneration.java:165) 
     at com.webobjects.eoaccess.EOEntity.schemaBasedQualifier(EOEntity.java:4423) 
     at er.extensions.eof.ERXFetchSpecificationBatchIterator.<init>(ERXFetchSpecificationBatchIterator.java:136) 
     at er.extensions.eof.ERXFetchSpecificationBatchIterator.<init>(ERXFetchSpecificationBatchIterator.java:104) 
     at er.extensions.eof.ERXFetchSpecificationBatchIterator.<init>(ERXFetchSpecificationBatchIterator.java:91) 
     at com.clicktravel.mi.utilities.RawData.insert(RawData.java:203) 
     at com.clicktravel.mi.workbooks.DataDump.build(DataDump.java:44) 
     at com.clicktravel.mi.workbooks.ClickClientAnalysis.build(ClickClientAnalysis.java:31) 
     at com.clicktravel.travelsystem.AsposeReportTemplate$InternalThread.run(AsposeReportTemplate.java:42)


So i stuck a load of debugging in to look at the editing contexts involved in building the qualifier.


The editing context referenced as "ec" is this:


er.extensions.eof.ERXEC@7e9482


... and the qualifier looks like this:


<class com.webobjects.eocontrol.EOFetchSpecification(entityName=HotelVoucher,

 qualifier=((serviceDate between (com.webobjects.foundation.NSTimestamp)'2009-03-01 00:00:00 Etc/GMT' and (com.webobjects.foundation.NSTimestamp)'2009-03-31 00:00:00 Etc/GMT') and ((itinerary.organisation = (com.clicktravel.travelsystem.Client)'Stormking Ltd 70 er.extensions.eof.ERXEC@7e9482') and (status <> 2) and ((privacy = (java.lang.Boolean)'false') or (((user = (com.clicktravel.travelsystem.Employee)'Ms Beth Oleary 3327 er.extensions.eof.ERXEC@7e9482') or (itinerary.user = (com.clicktravel.travelsystem.Employee)'Ms Beth Oleary 3327 er.extensions.eof.ERXEC@7e9482')) and (privacy = (java.lang.Boolean)'true'))))),

 isDeep=true, usesDistinct=false,

 sortOrdering=null,

 hints=null,

 _prefetchingRelationshipKeyPaths = null)>


... as you can see, all the EO's referenced in the qualifier are all residing in the same EC (ERXEC@7e9482).


So, the question is where could this other editing context (ERXEC@748f91) come from ?


Thanks, Simon

 _______________________________________________
Do not post admin requests to the list. They will be ignored.
Webobjects-dev mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:

This email sent to email@hidden

  • Follow-Ups:
    • Re: ERXFetchSpecificationBatchIterator : Cannot obtain globalId for an object which is registered in an other than the databaseContext's active editingContext
      • From: Lachlan Deck <email@hidden>
  • Prev by Date: multipart/form-data issue
  • Next by Date: My provider moved my server and now...
  • Previous by thread: multipart/form-data issue
  • Next by thread: Re: ERXFetchSpecificationBatchIterator : Cannot obtain globalId for an object which is registered in an other than the databaseContext's active editingContext
  • Index(es):
    • Date
    • Thread