~launchpad-pqm/launchpad/devel

« back to all changes in this revision

Viewing changes to lib/lp/services/database/sqlbase.py

Merged fix-retest-colorize into redo-read-only-transactions-in-buildmaster, resolving several import conflicts.

Show diffs side-by-side

added added

removed removed

Lines of Context:
56
56
from zope.interface import implements
57
57
from zope.security.proxy import removeSecurityProxy
58
58
 
59
 
from canonical.config import dbconfig
60
 
from canonical.database.interfaces import ISQLBase
 
59
from lp.services.config import dbconfig
 
60
from lp.services.database.interfaces import ISQLBase
61
61
from lp.services.propertycache import clear_property_cache
62
62
 
63
63
# Default we want for scripts, and the PostgreSQL default. Note psycopg1 will
112
112
    """Return the store used by the SQLObject compatibility layer."""
113
113
    # XXX: Stuart Bishop 20080725 bug=253542: The import is here to work
114
114
    # around a particularly convoluted circular import.
115
 
    from canonical.launchpad.webapp.interfaces import (
 
115
    from lp.services.webapp.interfaces import (
116
116
            IStoreSelector, MAIN_STORE, DEFAULT_FLAVOR)
117
117
    return getUtility(IStoreSelector).get(MAIN_STORE, DEFAULT_FLAVOR)
118
118
 
540
540
    """A decorator that blocks implicit flushes on the main store."""
541
541
 
542
542
    def block_implicit_flushes_decorator(*args, **kwargs):
543
 
        from canonical.launchpad.webapp.interfaces import DisallowedStore
 
543
        from lp.services.webapp.interfaces import DisallowedStore
544
544
        try:
545
545
            store = _get_sqlobject_store()
546
546
        except DisallowedStore:
590
590
    """
591
591
    # We must connect to the read-write DB here, so we use rw_main_master
592
592
    # directly.
593
 
    from canonical.database.postgresql import ConnectionString
 
593
    from lp.services.database.postgresql import ConnectionString
594
594
    con_str = ConnectionString(dbconfig.rw_main_master)
595
595
    if user is not None:
596
596
        con_str.user = user