Index: openacs-4/packages/xowiki/xowiki.info =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/xowiki/xowiki.info,v diff -u -r1.168 -r1.169 --- openacs-4/packages/xowiki/xowiki.info 26 Jun 2018 10:25:30 -0000 1.168 +++ openacs-4/packages/xowiki/xowiki.info 27 Jun 2018 12:07:09 -0000 1.169 @@ -10,7 +10,7 @@ t xowiki - + Gustaf Neumann A xotcl-based enterprise wiki system with multiple object types 2017-08-06 @@ -55,11 +55,11 @@ BSD-Style 2 - + - + Index: openacs-4/packages/xowiki/tcl/includelet-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/xowiki/tcl/includelet-procs.tcl,v diff -u -r1.225 -r1.226 --- openacs-4/packages/xowiki/tcl/includelet-procs.tcl 11 Jun 2018 18:47:26 -0000 1.225 +++ openacs-4/packages/xowiki/tcl/includelet-procs.tcl 27 Jun 2018 12:07:09 -0000 1.226 @@ -410,15 +410,15 @@ # # Get the HTML from the rendered includelet by calling "next" # - set HTML [ns_cache eval xowiki_cache $key next] + set HTML [::xowiki::cache eval -partition_key ${:package_id} $key next] # # Some side-effects might be necessary, even when the HTML output # of the includelet is cached (e.g. some associative arrays, # etc.). For this purpose, we provide here a means to cache # additional some "includelet data", if the includelet provides # it. # - if {[catch {set data [ns_cache get xowiki_cache $key-data]}]} { + if {[catch {set data [::xowiki::cache get -partition_key ${:package_id} $key-data]}]} { :cache_includelet_data $key-data } else { #:msg "eval $data" @@ -428,9 +428,12 @@ } -instproc cache_includelet_data {key} { #:msg "data=[next]" set data [next] - if {$data ne ""} {ns_cache set xowiki_cache $key $data} + if {$data ne ""} { + ::xowiki::cache set -partition_key ${:package_id} $key $data + } } } + namespace eval ::xowiki::includelet { ############################################################################# # dotlrn style includelet decoration for includelets @@ -4485,7 +4488,11 @@ set cmd [list ::xowiki::includelet::random-form-page page_names $package_id $form $publish_status] if {[ns_info name] eq "NaviServer"} { - set names [ns_cache_eval -expires $expires xowiki_cache random-$package_id-$form $cmd] + set names [::xowiki::cache \ + -expires $expires \ + -partition_key $package_id \ + random-$package_id-$form \ + $cmd] } else { set names [util_memoize $cmd] } Index: openacs-4/packages/xowiki/tcl/link-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/xowiki/tcl/link-procs.tcl,v diff -u -r1.105 -r1.106 --- openacs-4/packages/xowiki/tcl/link-procs.tcl 20 May 2018 11:01:57 -0000 1.105 +++ openacs-4/packages/xowiki/tcl/link-procs.tcl 27 Jun 2018 12:07:09 -0000 1.106 @@ -586,10 +586,22 @@ } # - # link cache + # Link cache - deactivated. + # When it will become activated again, it should get its own cache. # - # Class create LinkCache + # LinkCache proc flush {parent_id {item_id ""}} { + # if {$item_id eq ""} { + # :xo::clusterwide xo::cache_flush_all xowiki_cache link-*-$name-$parent_id + # } else { + # foreach entry [ns_cache names xowiki_cache link-*-$parent_id] { + # array set tmp [ns_cache get xowiki_cache $entry] + # if {$tmp(item_id) == $item_id} { + # ::xo::clusterwide ns_cache flush xowiki_cache $entry + # } + # } + # } + # } # LinkCache instproc resolve {} { # set key link-[:type]-[:name]-${:parent_id} # while {1} { Index: openacs-4/packages/xowiki/tcl/package-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/xowiki/tcl/package-procs.tcl,v diff -u -r1.323 -r1.324 --- openacs-4/packages/xowiki/tcl/package-procs.tcl 26 Jun 2018 10:25:30 -0000 1.323 +++ openacs-4/packages/xowiki/tcl/package-procs.tcl 27 Jun 2018 12:07:09 -0000 1.324 @@ -2410,9 +2410,7 @@ } Package instproc flush_name_cache {-name:required -parent_id:required} { - # Different machines in the cluster might have different entries in their caches. - # Since we use wild-cards to find these, it has to be done on every machine - ::xo::clusterwide xo::cache_flush_all xowiki_cache link-*-$name-$parent_id + # xowiki::LinkCache flush $parent_id ::xo::xotcl_object_type_cache flush -partition_key $parent_id $parent_id-$name } @@ -2587,10 +2585,7 @@ all {set key PF-${:id}-*} default {error "unknown scope for flushing page fragment cache"} } - foreach entry [ns_cache names xowiki_cache $key] { - #:log "::xo::clusterwide ns_cache flush xowiki_cache $entry" - ::xo::clusterwide ns_cache flush xowiki_cache $entry - } + xowiki::cache flush_pattern -partition_key ${:id} $key } # Index: openacs-4/packages/xowiki/tcl/xowiki-form-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/xowiki/tcl/xowiki-form-procs.tcl,v diff -u -r1.146 -r1.147 --- openacs-4/packages/xowiki/tcl/xowiki-form-procs.tcl 20 May 2018 11:01:57 -0000 1.146 +++ openacs-4/packages/xowiki/tcl/xowiki-form-procs.tcl 27 Jun 2018 12:07:09 -0000 1.147 @@ -375,17 +375,11 @@ # The logic could be made more intelligent to delete entries is more rare cases, like # in case the file was renamed, but this is more bullet-proof. # - # In case "ns_cache names xowiki_cache *pattern*" is not working on your installation; - # upgrade ns_cache from cvs or use - # foreach entry [lsearch -inline -all [ns_cache names xowiki_cache] link-*-${:folder_id}] - foreach entry [ns_cache names xowiki_cache link-*-${:folder_id}] { - array set tmp [ns_cache get xowiki_cache $entry] - if {$tmp(item_id) == [${:data} set item_id]} { - ::xo::clusterwide ns_cache flush xowiki_cache $entry - } - } - if {![${:data} istype ::xowiki::Object] && - ![${:data} istype ::xowiki::PageTemplate] } { + # xowiki::LinkCache flush ${:folder_id} [${:data} set item_id] + # + if {![${:data} istype ::xowiki::Object] + && ![${:data} istype ::xowiki::PageTemplate] + } { if {[${:data} istype ::xowiki::PageInstance]} { if {[${:data} set instance_attributes] ne ""} { # Index: openacs-4/packages/xowiki/tcl/xowiki-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/xowiki/tcl/xowiki-procs.tcl,v diff -u -r1.527 -r1.528 --- openacs-4/packages/xowiki/tcl/xowiki-procs.tcl 22 Jun 2018 11:56:11 -0000 1.527 +++ openacs-4/packages/xowiki/tcl/xowiki-procs.tcl 27 Jun 2018 12:07:09 -0000 1.528 @@ -497,18 +497,16 @@ # # Create the xowiki_cache # - # We do here the same as in xotcl-core/tcl/05-db-procs.tcl - # Read there for the reasons, why the cache is not created in - # a -init file..... + # We do here the same way as in xotcl-core/tcl/05-db-procs.tcl # - if {[catch {ns_cache flush xowiki_cache NOTHING}]} { + if {[catch {ns_cache flush xowiki_cache-0 NOTHING}]} { ns_log notice "xotcl-core: creating xowiki cache" - ns_cache create xowiki_cache \ - -size [parameter::get_global_value \ - -package_key xowiki \ - -parameter CacheSize \ - -default 400000] + ::acs::KeyPartitionedCache create ::xowiki::cache \ + -name xowiki_cache \ + -package_key xowiki \ + -parameter Cache \ + -default_size 400000 } ############################# @@ -3145,7 +3143,7 @@ # change. Therefore, we can easily cache the full file name # for the revision_id. # - set :full_file_name [ns_cache eval xowiki_cache ffn-${:revision_id} { + set :full_file_name [::xowiki::cache eval -partition_key ${:revision_id} ffn-${:revision_id} { return [content::revision::get_cr_file_path -revision_id ${:revision_id}] }] #:log "--F setting full-file-name of ${:revision_id} ${:full_file_name}"