Begin main content
Methods: Source: Variables:
[All Methods | Documented Methods | Hide Methods] [Display Source | Hide Source] [Show Variables | Hide Variables]

::xotcl::Class[i] ::xo::db::CrCache

Class Hierarchy of ::xo::db::CrCache

  • ::xotcl::Object[i]
    Methods for instances:
    __api_make_doc, __api_make_forward_doc, __timediff, abstract, ad_doc, ad_forward, ad_proc, appendC, arrayC, asHTML, autonameC, check, classC, cleanupC, configureC, containsC, copyC, db_0or1rowC, db_1rowC, debug, defaultmethodC, destroyC, destroy_on_cleanup, ds, evalC, existsC, extractConfigureArg, filterC, filterguardC, filtersearch, forward, hasclass, incrC, infoC, init, instvarC, invarC, isclass, ismetaclass, ismixin, isobject, istype, lappendC, log, method, mixinC, mixinguardC, moveC, msg, noinitC, objectparameter, parametercmdC, proc, procsearch, qn, requireNamespaceC, residualargsC, self, serialize, setC, set_instance_vars_defaults, show-object, substC, traceC, unknown, unsetC, uplevelC, upvarC, volatileC, vwait
    Methods to be applied on the class (in addition to the methods provided by the meta-class):
    getExitHandler, setExitHandler, unsetExitHandler
    • ::xo::db::CrCache[i]
      Methods for instances:
      delete, fetch_object
      Methods to be applied on the class:
      Methods provided by the meta-class

Class Relations

  • superclass: ::xotcl::Object[i]
::xotcl::Class create ::xo::db::CrCache \
     -superclass ::xotcl::Object


  • instproc delete

    ::267061 instproc delete -item_id {
        ::xo::clusterwide ns_cache flush xotcl_object_cache ::$item_id
        # we should probably flush as well cached revisions
  • instproc fetch_object

    ::267061 instproc fetch_object {-item_id:required {-revision_id 0} -object:required {-initialize true}} {
        set serialized_object [ns_cache eval xotcl_object_cache $object {
          #my log "--CACHE true fetch [self args]" 
          set loaded_from_db 1
          # Call the showdowed method with initializing turned off. We
          # want to store object before the after-load initialize in the
          # cache to save storage.
          set o [next -item_id $item_id -revision_id $revision_id -object $object -initialize 0]
          return [::Serializer deepSerialize $o]
        #my log "--CACHE: [self args], created [info exists created] o [info exists o]"
        if {[info exists loaded_from_db]} {
          # The basic fetch_object method creates the object, we have
          # just to run the after load init (if wanted)
          if {$initialize} {$object initialize_loaded_object}
        } else {
          # The variable serialized_object contains the serialization of
          # the object from the cache; check if the object exists already
          # or create it.
          if {[my isobject $object]} {
    	# There would have been no need to call this method. We could
            # raise an error here.  
    	# my log "--!! $object exists already"
          } else {
    	# Create the object from the serialization and initialize it
            eval $serialized_object
    	if {$initialize} {$object initialize_loaded_object}
        return $object


::xo::db::CrCache set __default_metaclass ::xotcl::Class
::xo::db::CrCache set __default_superclass ::xotcl::Object

Methods: Source: Variables:
[All Methods | Documented Methods | Hide Methods] [Display Source | Hide Source] [Show Variables | Hide Variables]