• 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
failed to find a snapshot for EO with Global ID
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

failed to find a snapshot for EO with Global ID


  • Subject: failed to find a snapshot for EO with Global ID
  • From: Ramsey Gurley <email@hidden>
  • Date: Mon, 11 Jun 2012 18:03:32 -0700

Hi all,

I have a suspicion that something is wrong with the way nested ECs are currently working. The errors I see are the result of missing snapshots.  The errors are very sporadic and hard to reproduce. I've managed to distill this down to a simple test case.  If I drop this:

    public void testNestedECs() {
    try {
    EOEditingContext ec = ERXEC.newEditingContext();
    for(int i = 0; i < 100; i++) {
    Company c = (Company) EOUtilities.createAndInsertInstance(ec, Company.ENTITY_NAME);
    c.setName(UUID.randomUUID().toString());
    ec.saveChanges();
    EOEditingContext nested = ERXEC.newEditingContext(ec);
    Company nestC = c.localInstanceIn(nested);
    for(int j = 0; j < 10; j++) {
    Employee e = (Employee) EOUtilities.createAndInsertInstance(nested, Employee.ENTITY_NAME);
    e.setFirstName(UUID.randomUUID().toString());
    e.setLastName(UUID.randomUUID().toString());
    e.setManager(Boolean.FALSE);
    e.addObjectToBothSidesOfRelationshipWithKey(nestC, Employee.COMPANY_KEY);
    nested.saveChanges();
    ec.saveChanges();
    }
    c.delete();
    ec.saveChanges(); //Line 78
    }
    } catch (Exception e) {
    e.printStackTrace();
    Assert.fail(e.getMessage());
    }
    }

into ERXECTest.java, I get fairly reliable failures due to missing snapshots.

java.lang.IllegalStateException: recordDeleteForObject: com.webobjects.eoaccess.EODatabaseContext com.webobjects.eoaccess.EODatabaseContext@489bb457 failed to find a snapshot for EO with Global ID:_EOIntegralKeyGlobalID[Employee (java.lang.Integer)491] that has been deleted from er.extensions.eof.ERXECer.extensions.eof.ERXEC@44581ea2. Cannot delete an object that has not been fetched from the database
at com.webobjects.eoaccess.EODatabaseContext.recordDeleteForObject(EODatabaseContext.java:4732)
at com.webobjects.eoaccess.EODatabaseContext.recordChangesInEditingContext(EODatabaseContext.java:5890)
at com.webobjects.eocontrol.EOObjectStoreCoordinator.saveChangesInEditingContext(EOObjectStoreCoordinator.java:373)
at com.webobjects.eocontrol.EOEditingContext.saveChanges(EOEditingContext.java:3192)
at er.extensions.eof.ERXEC._saveChanges(ERXEC.java:1177)
at er.extensions.eof.ERXEC.saveChanges(ERXEC.java:1100)
at er.extensions.eof.ERXECTest.testNestedECs(ERXECTest.java:78)

If I drop the number of loops down to 10 instead of 100, I don't see the exceptions.  Does anyone see an obvious problem with my test case or perhaps have ideas about what's going wrong before I begin digging? :-)

Ramsey


 _______________________________________________
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: failed to find a snapshot for EO with Global ID
      • From: Alexis Tual <email@hidden>
  • Prev by Date: Re: Backup WebObjects Developer - Found
  • Next by Date: Re: failed to find a snapshot for EO with Global ID
  • Previous by thread: Re: Backup WebObjects Developer - Found
  • Next by thread: Re: failed to find a snapshot for EO with Global ID
  • Index(es):
    • Date
    • Thread