On May 29, 2009, at 2:25 PM, Timo Hoepfner wrote:

Thanks for your help Chuck,

Been there...

Glad to hear I'm not dreaming this.

Oh, it gets worse. Schroedinger's Cat. Logging out some debug information (currentSnapshot and committedSnapshot come to mind) can make the problem go away! Of course, once you are satisfied that you have fixed the problem and remove the debug statements, it comes back.


I have seen this in these cases:
1. Use of unlocked editing context

see below

2. Use of mutable attributes

I'm 100% certain this is not the case.

3. Faults firing during saveChanges (while processing deletes in particular)

Everything happens in one EC. The order shouldn't be a fault at this point,

It does not need to be the order. It can be any object that is touched during the save process.


as the order was created and saved in it already. But nevertheless, my stomack says, this is the route to follow. I keep the session alife indefinitely using ERXJSLifebeat, and I'm under the impression the problem happens more often after either app-startup or a long period of idle time. Maybe something getting garbage collected/ invalidated after a while?

That is possible, but I have no recollection of running into these sorts of problems. It is certainly something to be suspicious of.




Is there any chance that autolocking is turned off for ERXEC?

I'm pretty sure it's not, but I'll add more checks. The annoying part of the problem is, that it's so hard to reproduce.

Which means that it is caused by concurrency.


I've setup Selenium tests, creating 100 orders each, but none of the tests exhibits the problem.

You need to run these in parallel, preferrably on more than one machine and also reproduce the other system activity.


In production I get around 10 "bad orders" a day, while 50-300 orders work fine. This morning I could immedeately reproduce the problem 2 times in a row and already felt on the winning road, but after that, it took hors to get the next failure...

That is pretty much par for the course. Thinking about this some more, I think this is what is happening:

1. Order is changed
2. EC records snapshot and adds object to updated list
3. Notification is received, updated list is discarded (along with inserted and deleted) 4. saveChanges is called, and seeing nothing in the updated list, does nothing.



Thanks for your help. I owe you some gallons of beer at WOWODC. :)


No need, but you can help me drink some.  :-)

Chuck


--
Chuck Hill             Senior Consultant / VP Development

Come to WOWODC'09 in San Fran this June!
http://www.wocommunity.org/wowodc09/

_______________________________________________
Do not post admin requests to the list. They will be ignored.
Webobjects-dev mailing list      ([email protected])
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/webobjects-dev/archive%40mail-archive.com

This email sent to [email protected]

Reply via email to