• 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
Re: 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]

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


  • Subject: Re: Cannot obtain globalId for an object which is registered in an other than the databaseContext's active editingContext
  • From: Chuck Hill <email@hidden>
  • Date: Fri, 27 Feb 2015 04:58:54 +0000
  • Thread-topic: Cannot obtain globalId for an object which is registered in an other than the databaseContext's active editingContext

On 2015-02-25, 9:56 AM, "OC" wrote:

For a change, something pretty weird.

Oh good!  I was getting tired of the normal problems!  :-P


I've got a report with a log which includes

===
25.2 11:00:21: about to perform 2 DB operations in er.extensions.eof.ERXEC@63be527e...
- 1: INSERT on 'DBUserAuction'  4{creationDate:2015-02-25 10:00:19 Etc/GMT, user_id:1000042, auction_id:1000260, favourited:false}
- 2: UPDATE on 'DBAuction' ((uid = 1000260) and (commodityPriceSelectionType = 1040355)) 1{commodityTimechunksString:<com.webobjects.foundation.NSKeyValueCoding$Null>}

cannot save changes: Cannot obtain globalId for an object which is registered in an other than the databaseContext's active editingContext, object: <DBAuction@820157825 PK:1000260 E:1 Title:'Dodávka elekt?iny v nap??ové hladin? nízkého nap?tí' /EC:749e8ece>, databaseContext: com.webobjects.eoaccess.EODatabaseContext@43afebc9, object's editingContext: er.extensions.eof.ERXEC@749e8ece, databaseContext's active editingContext: er.extensions.eof.ERXEC@63be527e
at cz.ocs.Static.PRINT_ERROR(Static.groovy:15)
at cz.ocs.model.OCSEnterpriseObject.saveChangesWithEC(OCSEnterpriseObject.groovy:812)
at cz.ocs.model.OCSEnterpriseObject.saveChangesWithEC(OCSEnterpriseObject.groovy)
at cz.ocs.model.OCSEnterpriseObject$saveChangesWithEC$7.call(Unknown Source)
at app.Session.saveChanges(Session.groovy:210)
...
===

Now, at the surface, it makes perfect sense -- my own logs concur that EC 63be527e was saving and that the DBAuction object belonged to EC 749e8ece, EOF has full right to scream.

I wonder though -- how the H might it happen that an object of another EC gets into this one's update list?!? That's the main reason I write: is there a well-known condition which would lead to this? Note that no objects were added to any relationships; simply, one has been inserted, another updated[*].

Well, the usual way to cause this is to add an object in one EC to the relationship of an object in a second EC.


Note: both ECs, far as I can say from the logs, seem to be defaultECs of different sessions. The one in which the save was attempted indeed belonged to the user who initiated the request; so far I haven't been able to find any link to the other user, its session or its EC (it run concurrently, without any problem).

Also: there was not one exception reported from the launch; this weirdness is the first problem in my whole log. And those background import tasks of mine, which might smell fishy for they use their own ECs, were not run at all.

That is odd.  The other explanation is that a previous save failed in a very odd way and left the database context thinking it was still saving the EC.


[*] Finally, whilst the INSERT is all right and should happen precisely this way, the UPDATE is fishy and should not happen -- actually, most time from the moment I've got the report I've spend finding how the darn it is possible that commodityTimechunksString gets NULLed, and so far the only result is „magic“ -- none of parts of my code which might do that had any right to be run at the moment.

I really, really have no idea.


Chuck
 _______________________________________________
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

References: 
 >Cannot obtain globalId for an object which is registered in an other than the databaseContext's active editingContext (From: OC <email@hidden>)

  • Prev by Date: Re: Snapshot access NPE
  • Next by Date: Re: in another EC, when objects transferred through GIDs, owning relationship does not delete objects?!?
  • Previous by thread: Cannot obtain globalId for an object which is registered in an other than the databaseContext's active editingContext
  • Next by thread: in another EC, when objects transferred through GIDs, owning relationship does not delete objects?!?
  • Index(es):
    • Date
    • Thread