Index: openacs-4/packages/xotcl-core/tcl/05-db-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/xotcl-core/tcl/05-db-procs.tcl,v diff -u -r1.36 -r1.37 --- openacs-4/packages/xotcl-core/tcl/05-db-procs.tcl 17 Sep 2007 00:48:52 -0000 1.36 +++ openacs-4/packages/xotcl-core/tcl/05-db-procs.tcl 20 Sep 2007 12:05:34 -0000 1.37 @@ -9,6 +9,27 @@ namespace eval ::xo::db { # + # 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 + } + # # A few helper functions # # Constaint names are limited in oracle to 30 characters; 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.5 --- 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 12:05:34 -0000 1.5 @@ -1,5 +1,14 @@ +# 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 +#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]