- Methods: All Methods Documented Methods Hide Methods
- Source: Display Source Hide Source
- Variables: Show Variables Hide Variables
Class ::xo::db::CrCache::Item
::xo::db::CrCache::Item create ...
Class Relations
::xotcl::Class create ::xo::db::CrCache::Item \ -superclass ::xotcl::ObjectMethods (to be applied on instances)
delete (scripted)
# # Not all cr_items are cached. Some of the bulk creation commands # create autonamed items, which have non-numeric object names. So # the flush on these will fail anyhow, since these were never # added to the cache. # if {[:is_cached_object]} { ::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} nextflush_from_cache_and_refresh (scripted)
# cache only names with IDs set obj [self] set canonical_name ::[$obj item_id] if {[$obj is_cached_object]} { ::xo::xotcl_object_cache flush [string trimleft $obj :] } if {$obj eq $canonical_name} { #:log "--CACHE saving $obj in cache" # # The object name is equal to the item_id; we assume, this is a # fully loaded object, containing all relevant instance # variables. We can restore it. After the flash # # We do not want to cache per object mixins for the # time being (some classes might be volatile). So save # mixin-list, cache and restore them later for the current # session. set mixins [$obj info mixin] $obj mixin [list] set npv [$obj remove_non_persistent_vars] ::xo::xotcl_object_cache set [string trimleft $obj :] [$obj serialize] $obj set_non_persistent_vars $npv $obj mixin $mixins } else { # # In any case, flush the canonical name. # ::xo::xotcl_object_cache flush [string trimleft $canonical_name :] } # To be on he safe side, delete the revision as well from the # cache, if possible. if {[$obj exists revision_id]} { set revision_id [$obj revision_id] set revision_obj ::$revision_id if {$obj ne $revision_obj} { ::xo::xotcl_object_cache flush $revision_id } } acs::per_request_cache flush -pattern xotcl-core.lookup-${:parent_id}-${:name}remove_non_persistent_vars (scripted)
# # Do not save __db__artefacts in the cache. # foreach x [info vars :__db_*] { unset :$x } # # Remove vars and arrays matching the class-specific specified # non_cached_instance_var_patterns and treat these as variables, # which are not stored in the cache, but which are kept in the # instance variables. These variables are removed before caching # and restored afterwards. # set arrays {} set scalars {} set non_cached_vars {} foreach pattern [[:info class] non_cached_instance_var_patterns] { lappend non_cached_vars {*}[:info vars $pattern] } #ns_log notice "pattern [[:info class] non_cached_instance_var_patterns], non_cached_vars <$non_cached_vars>" foreach x $non_cached_vars { if {[array exists :$x]} { lappend arrays $x [array get :$x] unset :$x } { lappend scalars $x [set :$x] unset -nocomplain :$x } } return [list $arrays $scalars]rename (scripted)
::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 nextsave (scripted)
# # We perform next before the cache update, since when update # fails, we do not want to populate wrong content in the cache. # set r [next] :flush_from_cache_and_refresh return $rsave_new (scripted)
set item_id [next] #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_idset_non_persistent_vars (scripted)
lassign $vars arrays scalars foreach {var value} $arrays {:array set $var $value} :mset $scalarsupdate_attribute_from_slot (scripted)
set r [next] :flush_from_cache_and_refresh return $r
- Methods: All Methods Documented Methods Hide Methods
- Source: Display Source Hide Source
- Variables: Show Variables Hide Variables