On Feb 23, 2009, at 9:13 PM, Jeff Schmitz wrote: Hello, In my app I frequently need to run operations that read in nearly all the data in my database. One I run in the foreground (I have concurrent request handling on), and another I run in the background with its own EOObjectStoreCoordinator. If I understand how things work (and there's no guarantee of that), that would mean I basically have 4 copies of my database in memory at once (2 ECs and to object stores). As I use the data in a serial fashion, I was wondering if there's a way to release the EOs that are held in memory in both the EC and the Object Store once I know my each process is through with them, especially for the threaded process that has its own object store? Is just using ec.reset() at key points the way to go for the ec's? What about for the object stores?
Thanks, Jeff _______________________________________________
Chuck's comments in his reply are on point. You should realize, however, that it is difficult and sometimes not worth it to do things like this in WO. WebObjects is just not good at any sort of "load all my data in and do stuff with it" operations. WO relies on lazy loading (insofar as it can, when using java), it tries to keep cached copies of things to enable re-use (you have to beat it about the head to let go of those references) and it does a lot to optimize other use cases, at the expense of this one. Also, WO's SQL is usable by any database but optimal for none.
I have gotten to the point where I put admin stuff like this in perl scripts that generate SQL. It sounds old school, but it gives me much less grief. You can do the right SQL, you can optimize things (usually), and simple tools do not need as much babysitting.
cheers - ray |