Bugzilla – Bug 401
make collections updatable
Last modified: 2008-04-22 17:47:47
You need to log in before you can comment on or make changes to this bug.
completely loading a huge collection causes heavy db traffic. this could be avoided if there was a possibility to update a collection with only the latest additions to it by referring to a certain column (e.g. id) and only loading records having a bigger id than the object last fetched from db (cc: to manfred because it is his original idea.)
Created an attachment (id=19) [details] Patch for making subnode-collections updateable By modifying the type.porperties (to let Helma know which creterias are used for updating this collection) and calling ".updateSubnodes()" inside the JavaScript-environment, ONLY these new Nodes will be fetched from the database. For example: type.properties: someCollection=collection(somePrototype) someCollection.order=SOMEFIELD desc, ..... someCollection.updateCreteria=ID asc, CREATETIME asc (Database fieldnames are in upper case) This mapping would cause someCollection.updateSubnodes() to fetch all Nodes having a higher ID than the highest ID currently known and all Nodes having a higher CREATETIME than the highest CREATETIME known. These nodes would be added to this collection honouring the order given by the type.properties.
Committed Manfred's last patch to CVS branch "updateable_collections"
Doesn't seem to work. First: Both collection properties "updateable" and "updateCriteria" seem to be loaded only at startup but not on the fly. Second: Even if I use the ID column (autoincrement) as updateCriteria, old rows are read and added to the collection so that I end up having the same rows over and over again, when this collection is updated (using MySQL).