server/repository.py
branchstable
changeset 5747 d6ac0cd30fde
parent 5711 ea2538a3c622
child 5749 b4393b681f7a
equal deleted inserted replaced
5746:f4fc424747db 5747:d6ac0cd30fde
   348                 continue
   348                 continue
   349         if self.pyro_registered:
   349         if self.pyro_registered:
   350             pyro_unregister(self.config)
   350             pyro_unregister(self.config)
   351         hits, misses = self.querier.cache_hit, self.querier.cache_miss
   351         hits, misses = self.querier.cache_hit, self.querier.cache_miss
   352         try:
   352         try:
   353             self.info('rqlt st cache hit/miss: %s/%s (%s%% hits)', hits, misses,
   353             self.info('rql st cache hit/miss: %s/%s (%s%% hits)', hits, misses,
   354                       (hits * 100) / (hits + misses))
   354                       (hits * 100) / (hits + misses))
   355             hits, misses = self.system_source.cache_hit, self.system_source.cache_miss
   355             hits, misses = self.system_source.cache_hit, self.system_source.cache_miss
   356             self.info('sql cache hit/miss: %s/%s (%s%% hits)', hits, misses,
   356             self.info('sql cache hit/miss: %s/%s (%s%% hits)', hits, misses,
   357                       (hits * 100) / (hits + misses))
   357                       (hits * 100) / (hits + misses))
   358             nocache  = self.system_source.no_cache
   358             nocache  = self.system_source.no_cache
   501 
   501 
   502     def properties(self):
   502     def properties(self):
   503         """return a result set containing system wide properties"""
   503         """return a result set containing system wide properties"""
   504         session = self.internal_session()
   504         session = self.internal_session()
   505         try:
   505         try:
   506             return session.execute('Any K,V WHERE P is CWProperty,'
   506             # don't use session.execute, we don't want rset.req set
   507                                    'P pkey K, P value V, NOT P for_user U',
   507             return self.querier.execute(session, 'Any K,V WHERE P is CWProperty,'
   508                                    build_descr=False)
   508                                         'P pkey K, P value V, NOT P for_user U',
       
   509                                         build_descr=False)
   509         finally:
   510         finally:
   510             session.close()
   511             session.close()
   511 
   512 
   512     # XXX protect this method: anonymous should be allowed and registration
   513     # XXX protect this method: anonymous should be allowed and registration
   513     # plugged
   514     # plugged
   588           built on select queries
   589           built on select queries
   589         """
   590         """
   590         session = self._get_session(sessionid, setpool=True)
   591         session = self._get_session(sessionid, setpool=True)
   591         try:
   592         try:
   592             try:
   593             try:
   593                 return self.querier.execute(session, rqlstring, args,
   594                 rset = self.querier.execute(session, rqlstring, args,
   594                                             build_descr)
   595                                             build_descr)
       
   596                 # NOTE: the web front will (re)build it when needed
       
   597                 #       e.g in facets
       
   598                 #       Zeroed to avoid useless overhead with pyro
       
   599                 rset._rqlst = None
       
   600                 return rset
   595             except (Unauthorized, RQLSyntaxError):
   601             except (Unauthorized, RQLSyntaxError):
   596                 raise
   602                 raise
   597             except ValidationError, ex:
   603             except ValidationError, ex:
   598                 # need ValidationError normalization here so error may pass
   604                 # need ValidationError normalization here so error may pass
   599                 # through pyro
   605                 # through pyro