Index: openacs-4/packages/acs-tcl/tcl/acs-permissions-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-tcl/tcl/acs-permissions-procs.tcl,v diff -u -r1.47.2.5 -r1.47.2.6 --- openacs-4/packages/acs-tcl/tcl/acs-permissions-procs.tcl 28 Oct 2020 15:39:19 -0000 1.47.2.5 +++ openacs-4/packages/acs-tcl/tcl/acs-permissions-procs.tcl 6 Feb 2021 20:43:14 -0000 1.47.2.6 @@ -162,7 +162,7 @@ } # We have a per-request cache here - return [acs::per_request_cache eval -key acs-tcl.permission_p__cache($party_id,$object_id,$privilege) { + return [acs::per_request_cache eval -key acs-tcl.permission_p__cache-$party_id,$object_id,$privilege { db_string select_permission_p { select acs_permission.permission_p(:object_id, :party_id, :privilege)::integer from dual } Index: openacs-4/packages/acs-tcl/tcl/security-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-tcl/tcl/security-procs.tcl,v diff -u -r1.126.2.45 -r1.126.2.46 --- openacs-4/packages/acs-tcl/tcl/security-procs.tcl 14 Jan 2021 18:20:22 -0000 1.126.2.45 +++ openacs-4/packages/acs-tcl/tcl/security-procs.tcl 6 Feb 2021 20:43:14 -0000 1.126.2.46 @@ -2499,7 +2499,7 @@ # The per-request cache takes care of outputting error message only # once per request. # - return [acs::per_request_cache eval -key acs-tcl.security_provided_host_validated($host) { + return [acs::per_request_cache eval -key acs-tcl.security_provided_host_validated-$host { set result 1 if {$host ne ""} { if {![regexp {^[\w.:@+/=$%!*~\[\]-]+$} $host]} { Index: openacs-4/packages/acs-tcl/tcl/site-nodes-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-tcl/tcl/site-nodes-procs.tcl,v diff -u -r1.141.2.29 -r1.141.2.30 --- openacs-4/packages/acs-tcl/tcl/site-nodes-procs.tcl 1 Dec 2020 09:26:41 -0000 1.141.2.29 +++ openacs-4/packages/acs-tcl/tcl/site-nodes-procs.tcl 6 Feb 2021 20:43:14 -0000 1.141.2.30 @@ -1442,7 +1442,7 @@ } :protected method properties {-node_id:required,integer,1..1} { - return [acs::per_request_cache eval -key acs-tcl.site_nodes_property($node_id) { + return [acs::per_request_cache eval -key acs-tcl.site_nodes_property-$node_id { ::acs::site_nodes_cache eval -partition_key $node_id $node_id { next } }] } 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 -r1.76.2.39 -r1.76.2.40 --- openacs-4/packages/xotcl-core/tcl/cr-procs.tcl 5 Feb 2021 14:19:52 -0000 1.76.2.39 +++ openacs-4/packages/xotcl-core/tcl/cr-procs.tcl 6 Feb 2021 20:43:14 -0000 1.76.2.40 @@ -1001,6 +1001,10 @@ } ::xo::dc transaction { + # + # Provide a row-lock to protect against deadlocks during + # concurrent updates on the same item in different threads. + # ::xo::dc row_lock -for "no key update" -prepare integer item_lock { select item_id from cr_items where item_id = :item_id } @@ -1751,7 +1755,7 @@ # cache queries (and cache locks), since these lookups are # performed often many times per request. # - if {[acs::per_request_cache get -key xotcl-core.lookup($parent_id-$name) value]} { + if {[acs::per_request_cache get -key xotcl-core.lookup-$parent_id-$name value]} { return $value } @@ -1763,7 +1767,7 @@ # Not found, perform per-thread caching. This has to be # invalidated like the xotcl_object_type_cache. # - acs::per_request_cache eval -key xotcl-core.lookup($parent_id-$name) {set key 0} + acs::per_request_cache eval -key xotcl-core.lookup-$parent_id-$name {set key 0} #ns_log notice ".... lookup $parent_id-$name => 0 -> break and don't cache" break } @@ -1857,7 +1861,7 @@ ::xo::xotcl_object_cache flush $revision_id } } - acs::per_request_cache flush -pattern xotcl-core.lookup(${:parent_id}-${:name}) + acs::per_request_cache flush -pattern xotcl-core.lookup-${:parent_id}-${:name} } CrCache::Item instproc update_attribute_from_slot args { set r [next] @@ -1875,7 +1879,11 @@ } CrCache::Item instproc save_new args { set item_id [next] - acs::per_request_cache flush -pattern xotcl-core.lookup(${:parent_id}-${:name}) + ns_log notice "===== save_new acs::per_request_cache flush -pattern xotcl-core.lookup-${:parent_id}-${:name}" + acs::per_request_cache flush -pattern xotcl-core.lookup-${:parent_id}-${:name} + + + return $item_id } CrCache::Item instproc delete args { @@ -1889,12 +1897,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 xotcl-core.lookup(${:parent_id}-${:name}) + acs::per_request_cache flush -pattern xotcl-core.lookup-${: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 xotcl-core.lookup(${:parent_id}-$old_name) + acs::per_request_cache flush -pattern xotcl-core.lookup-${:parent_id}-$old_name next } 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.332.2.72 -r1.332.2.73 --- openacs-4/packages/xowiki/tcl/package-procs.tcl 6 Feb 2021 09:37:27 -0000 1.332.2.72 +++ openacs-4/packages/xowiki/tcl/package-procs.tcl 6 Feb 2021 20:43:14 -0000 1.332.2.73 @@ -2682,7 +2682,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 xotcl-core.lookup($parent_id-$name) + acs::per_request_cache flush -pattern xotcl-core.lookup-$parent_id-$name } Package instproc delete_revision {-revision_id:required -item_id:required} { Index: openacs-4/packages/xowiki/tcl/test/xowiki-test-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/xowiki/tcl/test/xowiki-test-procs.tcl,v diff -u -r1.1.2.36 -r1.1.2.37 --- openacs-4/packages/xowiki/tcl/test/xowiki-test-procs.tcl 8 Dec 2020 15:58:49 -0000 1.1.2.36 +++ openacs-4/packages/xowiki/tcl/test/xowiki-test-procs.tcl 6 Feb 2021 20:43:14 -0000 1.1.2.37 @@ -136,6 +136,9 @@ # Create the test folder ::xowiki::test::require_folder $testfolder $root_folder_id $package_id + set testfolder_id [::$package_id lookup -parent_id $root_folder_id -name $testfolder] + aa_true "can resolve '$testfolder'" {$testfolder_id > 0} + # # Force the system locale to en_US. The value is # automatically reset to the previous value, since we are @@ -167,7 +170,6 @@ set f1_p1_pl [::$f1_p1_id pretty_link] aa_equals "Pretty link of f1/page $f1_p1_pl" $f1_p1_pl "/xowiki-test/f1/p1" - set testfolder_id [::$package_id lookup -parent_id $root_folder_id -name $testfolder] ::xo::db::CrClass get_instance_from_db -item_id $testfolder_id set testfolder_pl [::$testfolder_id pretty_link] aa_equals "Pretty link of $testfolder $testfolder_pl" $testfolder_pl "$instance/$testfolder"