Re: failed to find a snapshot for EO with Global ID
Re: failed to find a snapshot for EO with Global ID
- Subject: Re: failed to find a snapshot for EO with Global ID
- From: Alexis Tual <email@hidden>
- Date: Wed, 13 Jun 2012 08:22:40 +1100
I'm also very curious about Ramsey's investigations because when this bug happens, you have to basically toss your EC stack...
Alex
2012/6/13 Calven Eggert
<email@hidden>
I'm very curious to see your findings. One of our WO apps have had this problem for years but it happens so infrequently that the users don't seem to be bothered. It bothers me though. argh.
Ah, so it's the garbage collection that's triggering it. I should have known, given the looping worked for small values. This is good. I can distill the failure down to a single pair of EOs using System.gc() now. This should make it a lot easier to investigate.
public void testNestedECs() {
try {
EOEditingContext ec = ERXEC.newEditingContext();
Company c = (Company) EOUtilities.createAndInsertInstance(ec, Company.ENTITY_NAME);
c.setName("Name");
ec.saveChanges();
EOEditingContext nested = ERXEC.newEditingContext(ec);
Company nestC = c.localInstanceIn(nested);
Employee e = (Employee) EOUtilities.createAndInsertInstance(nested, Employee.ENTITY_NAME);
e.setFirstName("First");
e.setLastName("Last");
e.setManager(Boolean.FALSE);
e.addObjectToBothSidesOfRelationshipWithKey(nestC, Employee.COMPANY_KEY);
nested.saveChanges();
ec.saveChanges();
System.gc();
c.delete();
ec.saveChanges();
} catch (Exception e) {
e.printStackTrace();
Assert.fail(e.getMessage());
}
}
Thanks Alexis,
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
_______________________________________________
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