Bug 401

Summary: make collections updatable
Product: Helma Reporter: tobi <interface@p3k.org>
Component: HopObject FunctionalityAssignee: Helma Developer Mailing List <helma-dev@helma.org>
Status: RESOLVED FIXED    
Severity: normal CC: manfred.andres@orf.at
Priority: P2    
Version: CVS trunk   
Target Milestone: ---   
Hardware: Other   
OS: other   
Bug Depends on:    
Bug Blocks: 398, 451    
Attachments: Patch for making subnode-collections updateable

Description From 2005-01-26 12:44:23
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.)
------- Comment #1 From 2005-02-01 10:24:06 -------
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.
------- Comment #2 From 2005-06-21 12:52:27 -------
Committed Manfred's last patch to CVS branch "updateable_collections"
------- Comment #3 From 2008-04-22 17:47:47 -------
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).