Index: openacs-4/packages/general-comments/tcl/general-comments-procs-oracle.xql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/general-comments/tcl/general-comments-procs-oracle.xql,v diff -u -r1.1 -r1.2 --- openacs-4/packages/general-comments/tcl/general-comments-procs-oracle.xql 14 Jun 2001 19:38:05 -0000 1.1 +++ openacs-4/packages/general-comments/tcl/general-comments-procs-oracle.xql 8 Feb 2003 02:18:01 -0000 1.2 @@ -25,7 +25,7 @@ - + select site_node.url(s.node_id) as package_url Index: openacs-4/packages/general-comments/tcl/general-comments-procs-postgresql.xql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/general-comments/tcl/general-comments-procs-postgresql.xql,v diff -u -r1.1 -r1.2 --- openacs-4/packages/general-comments/tcl/general-comments-procs-postgresql.xql 14 Jun 2001 19:38:05 -0000 1.1 +++ openacs-4/packages/general-comments/tcl/general-comments-procs-postgresql.xql 8 Feb 2003 02:18:01 -0000 1.2 @@ -25,7 +25,7 @@ - + select site_node__url(s.node_id) as package_url Index: openacs-4/packages/general-comments/tcl/general-comments-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/general-comments/tcl/general-comments-procs.tcl,v diff -u -r1.7 -r1.8 --- openacs-4/packages/general-comments/tcl/general-comments-procs.tcl 30 Nov 2002 17:36:30 -0000 1.7 +++ openacs-4/packages/general-comments/tcl/general-comments-procs.tcl 8 Feb 2003 02:18:01 -0000 1.8 @@ -183,14 +183,17 @@ ad_proc -private general_comments_package_url {} { Returns a url pointing to the mounted general-comments package. + Uses util_memoize for caching. } { + return [util_memoize [list general_comments_package_url_not_cached]] +} + +ad_proc -private general_comments_package_url_not_cached {} { + Returns a url pointing to the mounted general-comments package. + Goes to the database on every invocation. +} { - if { [db_0or1row get_package_url " - select site_node.url(s.node_id) as package_url - from site_nodes s, apm_packages a - where s.object_id = a.package_id and - lower(a.package_key) = 'general-comments' and - RowNum = 1" ] } { + if { [db_0or1row get_package_url "" ] } { return $package_url } else { # log an error message