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.44 -r1.45 --- openacs-4/packages/xotcl-core/tcl/cr-procs.tcl 2 Feb 2011 11:05:09 -0000 1.44 +++ openacs-4/packages/xotcl-core/tcl/cr-procs.tcl 21 Feb 2011 13:12:05 -0000 1.45 @@ -1555,8 +1555,24 @@ # remove as well vars and array starting with "__", assuming these # are volatile variables created by initialize_loaded_object or # similar mechanisms - foreach x [my info vars __*] {if {[my array exists $x]} {my array unset $x} {my unset $x}} + set arrays {} + set scalars {} + foreach x [my info vars __*] { + if {[my array exists $x]} { + lappend arrays $x [my array get $x] + my array unset $x + } { + lappend scalars $x [my set $x] + my unset $x + } + } + return [list $arrays $scalars] } + CrCache::Item instproc set_non_persistent_vars {vars} { + foreach {arrays scalars} $vars break + foreach {var value} $arrays {my array set $var $value} + foreach {var value} $scalars {my set $var $value} + } CrCache::Item instproc flush_from_cache_and_refresh {} { # cache only names with IDs set obj [self] @@ -1575,8 +1591,9 @@ # session. set mixins [$obj info mixin] $obj mixin [list] - $obj remove_non_persistent_vars + set npv [$obj remove_non_persistent_vars] ns_cache set xotcl_object_cache $obj [$obj serialize] + $obj set_non_persistent_vars $npv $obj mixin $mixins } else { # in any case, flush the canonical name