Пример #1
0
 def load_persistent(self, oid, klass):
   obj = ObjectReader.load_persistent(self, oid, klass)
   if self.oid_set is not None:
     if not self.lazy:
       self.oid_set.add(oid)
     obj._p_activate()
     self.oid_dict[oid] = oid_klass = ObjectWriter.persistent_id(self, obj)
     if oid_klass != (oid, klass):
       self.do_migrate = True
   return obj
Пример #2
0
def NewObjectReader_load_multi_persistent(self, database_name, oid, klass):
    conn = self._conn.get_connection(database_name)
    # TODO, make connection _cache attr public
    reader = ObjectReader(conn, conn._cache, classfactory.ClassFactory)
    return reader.load_persistent(oid, klass)
Пример #3
0
 def load_persistent(self, oid, klass):
     if self._counter >= self._chunk_size:
         self.garbage_collect_cache()
     ob = ObjectReader.load_persistent(self, oid, klass)
     self._counter += 1
     return ob