Helma logo
helma.org » Home > Stories > HopObject.prefetchChildren()

HopObject.prefetchChildren()

Manually retrieving a particular set of subnodes.

Syntax
HopObject.prefetchChildren(startNumber, lengthNumber)

This function provides some control of how many subnodes Helma should retrieve from the database and hold prepared in the node cache for further processing.

This means that for large collections Helma does not need to retrieve neither the subset of subnodes via one SQL statement for each subnode nor the whole collection at once via one statement.

Moreover, only subnodes are retrieved that are not in the node cache already which leads to a maximum of caching efficiency and loading performance.

Example
res.writeln(root.length);
53874
root.prefetchChildren(0, 3);
for (var i=0; i<3; i++)
  res.writeln(i + ": " + root.get(i));
HopObject 1
HopObject 5
HopObject 4



Page last modified on 2002-09-16 17:33 by tobi