Index: openacs-4/packages/xotcl-core/tcl/generic-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/xotcl-core/tcl/generic-procs.tcl,v diff -u -r1.40.2.5 -r1.40.2.6 --- openacs-4/packages/xotcl-core/tcl/generic-procs.tcl 19 Sep 2007 11:27:29 -0000 1.40.2.5 +++ openacs-4/packages/xotcl-core/tcl/generic-procs.tcl 20 Sep 2007 08:51:22 -0000 1.40.2.6 @@ -7,6 +7,27 @@ } namespace eval ::Generic { + # + # The ns_caches below should exist, before any cached objects are + # created. Under most conditions, it is sufficient to do this in + # object-cache-init.tcl, which is performed after xotcl-core procs + # are read, but before applications using it (e.g. xowiki). However, + # if e.g. xowiki is loaded via install.xml, the -init methods of + # xotcl-core are not executed (probably a bug). Without the + # ns_cache, creating objects fails with an error. So, we moved the + # cache creation here and create caches, when they do not exist + # already. This change makes the object-cache-init.tcl + # obsolete. + # + # Unfortunately, ns_cache has no command to check, whether + # a cache exists, so we use the little catch below to check. + # + if {[catch {ns_cache flush xotcl_object_cache NOTHING}]} { + ns_log notice "xotcl-core: creating xotcl-object caches" + + ns_cache create xotcl_object_cache -size 200000 + ns_cache create xotcl_object_type_cache -size 10000 + } Class CrClass -superclass Class -parameter { pretty_name Index: openacs-4/packages/xotcl-core/tcl/object-cache-init.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/xotcl-core/tcl/Attic/object-cache-init.tcl,v diff -u -r1.4 -r1.4.2.1 --- openacs-4/packages/xotcl-core/tcl/object-cache-init.tcl 17 Aug 2006 01:27:54 -0000 1.4 +++ openacs-4/packages/xotcl-core/tcl/object-cache-init.tcl 20 Sep 2007 08:51:22 -0000 1.4.2.1 @@ -1,5 +1,11 @@ +# +# The following two commands to setup the cache were moved to +# generic-procs due to problems with install.xml +# +# +# ns_cache create xotcl_object_cache -size 200000 +# ns_cache create xotcl_object_type_cache -size 10000 -ns_cache create xotcl_object_cache -size 200000 -ns_cache create xotcl_object_type_cache -size 10000 +# should provide parameter at some time... # [ad_parameter -package_id [ad_acs_kernel_id] MaxSize memoize 200000]