~launchpad-pqm/launchpad/devel

« back to all changes in this revision

Viewing changes to lib/canonical/database/sqlbase.py

[r=abentley, gmb, rockstar,
        jelmer][ui=none] Implement (but don't enable) a Storm and
        memcached-based representation cache for the web service.

Show diffs side-by-side

added added

removed removed

Lines of Context:
28
28
from zope.interface import implements
29
29
from zope.security.proxy import removeSecurityProxy
30
30
 
 
31
from lazr.restful.interfaces import IRepresentationCache
 
32
 
31
33
from canonical.config import config, dbconfig
32
34
from canonical.database.interfaces import ISQLBase
33
35
 
246
248
        """Inverse of __eq__."""
247
249
        return not (self == other)
248
250
 
 
251
    def __storm_flushed__(self):
 
252
        """Invalidate the web service cache."""
 
253
        cache = getUtility(IRepresentationCache)
 
254
        cache.delete(self)
 
255
 
249
256
alreadyInstalledMsg = ("A ZopelessTransactionManager with these settings is "
250
257
"already installed.  This is probably caused by calling initZopeless twice.")
251
258