site_node::update_cache (public)
site_node::update_cache [ -sync_children ] -node_id node_id \ [ -url url ] [ -object_id object_id ]
Defined in packages/acs-tcl/tcl/site-nodes-procs.tcl
Brings the in-memory copy of the site nodes hierarchy in sync with the database version. Only updates the given node and its children.
- Switches:
- -sync_children (optional, boolean)
- -node_id (required)
- -url (optional)
- -object_id (optional)
- Partial Call Graph (max 5 caller/called nodes):
- Testcases:
- No testcase defined.
Source code: ::acs::site_node flush_cache -node_id $node_id -with_subtree $sync_children_p -url $url set parent_node_id [site_node::get_parent_id -node_id $node_id] if {$parent_node_id ne ""} { ::acs::site_node flush_pattern -partition_key $parent_node_id get_children-$parent_node_id-* } # # In case update_cache is called after the deletion of the node # in the database, it is still necessary to flush for the # original object_id, but this can't be handled in the # recursive query of method "flush_cache". # if {$object_id ne ""} { ::acs::site_nodes_cache flush -partition_key $object_id urls-$object_id }Generic XQL file: packages/acs-tcl/tcl/site-nodes-procs.xql
PostgreSQL XQL file: <fullquery name="site_node::update_cache.select_child_site_nodes"> <querytext> with recursive site_node_tree as ( select node_id, parent_id, name, directory_p, pattern_p, object_id, 1 as tdepth from site_nodes where node_id = :node_id union all select c.node_id, c.parent_id, c.name, c.directory_p, c.pattern_p, c.object_id, tree.tdepth + 1 as tdepth from site_node_tree tree, site_nodes c where c.parent_id = tree.node_id ) select t.node_id, t.parent_id, t.name, t.directory_p, t.pattern_p, t.object_id, t.tdepth, p.package_key, p.package_id, p.instance_name, pt.package_type from site_node_tree t join apm_packages p on (t.object_id = p.package_id) join apm_package_types pt on (pt.package_key = p.package_key) order by tdepth, node_id </querytext> </fullquery> <fullquery name="site_node::update_cache.select_site_node"> <querytext> select n.node_id, n.parent_id, n.name, n.directory_p, n.pattern_p, n.object_id, p.package_key, p.package_id, p.instance_name, t.package_type from site_nodes n left join apm_packages p on n.object_id = p.package_id left join apm_package_types t using (package_key) where n.node_id = :node_id </querytext> </fullquery>packages/acs-tcl/tcl/site-nodes-procs-postgresql.xql
Oracle XQL file: <fullquery name="site_node::update_cache.select_child_site_nodes"> <querytext> select n.node_id, n.parent_id, n.name, n.directory_p, n.pattern_p, n.object_id, p.package_key, p.package_id, p.instance_name, t.package_type from apm_packages p, apm_package_types t, (select node_id, parent_id, name, directory_p, pattern_p, object_id, rownum as nodes_rownum from site_nodes connect by parent_id = prior node_id start with node_id = :node_id) n where n.object_id = p.package_id(+) and t.package_key (+) = p.package_key order by n.nodes_rownum </querytext> </fullquery> <fullquery name="site_node::update_cache.select_site_node"> <querytext> select n.node_id, n.parent_id, n.name, n.directory_p, n.pattern_p, n.object_id, p.package_key, p.package_id, p.instance_name, t.package_type from apm_packages p, apm_package_types t, site_nodes n where n.node_id = :node_id and n.object_id = p.package_id(+) and t.package_key (+) = p.package_key </querytext> </fullquery>packages/acs-tcl/tcl/site-nodes-procs-oracle.xql