Re: [Modeling-users] Some more questions
Status: Abandoned
Brought to you by:
sbigaret
From: Sebastien B. <sbi...@us...> - 2003-09-17 19:38:08
|
Back on an unanswered questions of yours: "Ernesto Revilla" <er...@si...> wrote: > Hi again, >=20 > Grand Totals, Counters, etc. > Say I have a heavily accesed table and I want to have grand totals per > month. What is the best way to accomplish this? (The problem is that > if I do this within the domain class, it has to read and update the > total with added/updated/deleted data, but during these operations > other people may also hace to need to update the same field, causing > collisions or overwriting. If there was a 'add' operation which would > be translated to SQL (field=3Dfiel+increment), this problem would > disappear, as it would be executed inside a transaction. Also, the > grand total should perhaps be a volatile field and no cached, that is, > whenever we access entity.getGrandTotal() it would be read from the > database.) In databases with triggers, this is easily resolved inside > the DB, but we still need volatile attributes. Due to time constraint tonight I won't exhaust all possibilities, but basically you get it right: if you know how to do this with triggers (which I surely the best way to achieve this in an highly-stressed db), then all that you need is a way to get the actual data in the db, not a cached version of your data. Right, this is yet unsupported, however this is planned, something like a 'refresh=3Dtrue' parameter in method ec.fetch(). This makes me think that this feature and the other one we discussed today, Optimistic Locking, requires that EditingContexts get notified of updates saved by an other EC, and updates their data accordingly. This is the very basis for both of these features. Now I need priority. As I said earlier, I'm currently working on dynamically instanciating modules/classes from a (py)model, either classic-style or new-style (with metaclasses). I can change priorities of tasks at demand, given that this demand is loudly expressed ;) As always, users' requests usually take precedence on my own willingness to code this or that, I just need to know your timeframe and when you think you'll need this. Regards, -- S=E9bastien. |