Index: openacs-4/packages/xotcl-core/xotcl-core.info
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/xotcl-core/xotcl-core.info,v
diff -u -N -r1.106.2.25 -r1.106.2.26
--- openacs-4/packages/xotcl-core/xotcl-core.info 19 Nov 2020 21:21:13 -0000 1.106.2.25
+++ openacs-4/packages/xotcl-core/xotcl-core.info 28 Jan 2021 02:25:10 -0000 1.106.2.26
@@ -10,7 +10,7 @@
t
xotcl
-
+
Gustaf Neumann
XOTcl library functionality (e.g. thread handling, online documentation, Generic Form and List Classes)
2017-08-06
@@ -42,12 +42,12 @@
BSD-Style
2
-
+
-
+
Index: openacs-4/packages/xotcl-core/tcl/cr-procs.tcl
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/xotcl-core/tcl/cr-procs.tcl,v
diff -u -N -r1.76.2.37 -r1.76.2.38
--- openacs-4/packages/xotcl-core/tcl/cr-procs.tcl 24 Jan 2021 19:54:13 -0000 1.76.2.37
+++ openacs-4/packages/xotcl-core/tcl/cr-procs.tcl 28 Jan 2021 02:25:10 -0000 1.76.2.38
@@ -1004,7 +1004,7 @@
::xo::dc row_lock -for "no key update" -prepare integer item_lock {
select item_id from cr_items where item_id = :item_id
}
-
+
[:info class] instvar storage_type
set revision_id [xo::dc nextval acs_object_id_seq]
if {$storage_type eq "file"} {
@@ -1041,7 +1041,7 @@
# revision_id, and let CrCache save it ......
#
}
-
+
#
# Update instance variables "modifying_user" and "last_modified"
# from potentially changed DB values.
@@ -1052,7 +1052,7 @@
from acs_objects where object_id = :revision_id
}
set :last_modified $last_modified
-
+
#
# In case the context_id has in the DB is different as in the
# instance variable, push the value from the instance variable
@@ -1742,13 +1742,28 @@
{-parent_id -100}
{-content_type}
} {
- # We need here the strange logic to avoid caching of lookup fails.
- # In order to cache fails as well, we would have to flush the fail
- # on new added items and renames.
+ #
+ # We need here the strange logic to avoid caching of lookup fails
+ # (when lookup returns 0). Adding cache-fails to the shared cache
+ # would lead to a high number of cache entries. Therefore, we add
+ # these to a per-request cache and (i.e. flush) these in sync with
+ # the xo::xotcl_object_type_cache. The avoids a high number of
+ # cache queries (and cache locks), since these lookups are
+ # performed often many times per request.
+ #
+ if {[acs::per_request_cache get -key xo-type-$parent_id-$name value]} {
+ return $value
+ }
+
while {1} {
set item_id [xo::xotcl_object_type_cache eval -partition_key $parent_id $parent_id-$name {
set item_id [next]
if {$item_id == 0} {
+ #
+ # Not found, perform per-thread caching. This has to be
+ # invalidated like the xotcl_object_type_cache.
+ #
+ acs::per_request_cache eval -key xo-type-$parent_id-$name {set key 0}
#ns_log notice ".... lookup $parent_id-$name => 0 -> break and don't cache"
break
}
@@ -1842,6 +1857,7 @@
::xo::xotcl_object_cache flush $revision_id
}
}
+ acs::per_request_cache flush -pattern xo-type-${:parent_id}-${:name}
}
CrCache::Item instproc update_attribute_from_slot args {
set r [next]
@@ -1859,6 +1875,7 @@
}
CrCache::Item instproc save_new args {
set item_id [next]
+ acs::per_request_cache flush -pattern xo-type-${:parent_id}-${:name}
return $item_id
}
CrCache::Item instproc delete args {
@@ -1872,10 +1889,12 @@
::xo::xotcl_object_cache flush [string trimleft [self] :]
}
xo::xotcl_object_type_cache flush -partition_key ${:parent_id} ${:parent_id}-${:name}
+ acs::per_request_cache flush -pattern xo-type-${:parent_id}-${:name}
next
}
CrCache::Item instproc rename {-old_name:required -new_name:required} {
::xo::xotcl_object_type_cache flush -partition_key ${:parent_id} ${:parent_id}-$old_name
+ acs::per_request_cache flush -pattern xo-type-${:parent_id}-$old_name
next
}
Index: openacs-4/packages/xowiki/xowiki.info
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/xowiki/xowiki.info,v
diff -u -N -r1.180.2.54 -r1.180.2.55
--- openacs-4/packages/xowiki/xowiki.info 18 Jan 2021 14:13:19 -0000 1.180.2.54
+++ openacs-4/packages/xowiki/xowiki.info 28 Jan 2021 02:25:10 -0000 1.180.2.55
@@ -10,7 +10,7 @@
t
xowiki
-
+
Gustaf Neumann
A xotcl-based enterprise wiki system with multiple object types
2017-08-06
@@ -55,8 +55,8 @@
BSD-Style
2
-
-
+
+
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 -N -r1.332.2.68 -r1.332.2.69
--- openacs-4/packages/xowiki/tcl/package-procs.tcl 18 Jan 2021 14:01:38 -0000 1.332.2.68
+++ openacs-4/packages/xowiki/tcl/package-procs.tcl 28 Jan 2021 02:25:10 -0000 1.332.2.69
@@ -2669,6 +2669,7 @@
Package instproc flush_name_cache {-name:required -parent_id:required} {
# xowiki::LinkCache flush $parent_id
::xo::xotcl_object_type_cache flush -partition_key $parent_id $parent_id-$name
+ acs::per_request_cache flush -pattern xo-type-$parent_id-$name
}
Package instproc delete_revision {-revision_id:required -item_id:required} {