Ok, so I turned off all the project wonder stuff (another 5 hours of work) and the thing keeps breaking. But I think I can rule out ERX* as the cause of the problem. I started looking way back on the list, and noticed that in early versions of WebObjects 5, tons of people (relatively speaking) where having the exact same problem I'm currently having. That is, when they were using nested editing contexts, they would often get messages and exceptions from EODatabase because of the (I think I've earned a rant here) poor, poor, pathetic job that EOF does of keeping track of the snapshots. I think that this has something to do with using nested editing contexts. I never once ran into the problem before I started using nested editing contexts (I was just creating EOs and not inserting them into an editing context, which worked fine), but after reading that this was one of the worst things I could do, changed all my code so that EOs immediately got inserted (there is now no instance of a EO constructor being called in my code. I use EOUtilities.createAndInsertInstance everywhere).
Are other people on the list creating EOs without inserting them into an editing context? Are other people using nested editing contexts? If not, how do you keep things from getting stuck in the database half finished all over the place? Tons of local variables? And if so, is no one else seeing these kinds of ridiculous corrupted snapshot problems?
I finally found a workaround that works, taken from a post in like 2002. In Application's constructor, I call
EODatabase.disableSnapshotRefCounting();
Supposedly, this means that memory from every snapshot ever created of any object will just stick around in the database until the application dies (I say supposedly, because I can't find a shred of documentation from Apple that says exactly that, but posts from other people have implied as much. Am I starting to sound bitter?). And if that is the case, it sucks to do it. The only thing that sucks worse is an application that breaks randomly and unpredictably everywhere I use a nested editing context. Is there some workaround to the workaround? That is, is there some way to periodically tell EODatabase to clean itself up so that it doesn't waste so much memory? Are people just scheduling monitor to restart their applications periodically?
Any thoughts?
Mark On Apr 21, 2007, at 3:08 PM, Kieran Kelleher wrote: AFAIK Project Wonder patches in ERXGenericRecord as a default entity class name for EOGenericRecord. Check this property in your Properties file er.extensions.ERXEntityClassDescription.defaultClassName
Look at method public void prepareEntityForRegistration(EOEntity eoentity) in ERXEntityClassDescription
On Apr 21, 2007, at 2:18 PM, Steven Mark McCraw wrote: A) Why are my EOs getting cast to ERXGenericRecord still, and how do I make that stop so that I can see if it is in fact the problem
|