~launchpad-pqm/launchpad/devel

« back to all changes in this revision

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

  • Committer: Launchpad Patch Queue Manager
  • Date: 2011-10-01 03:35:38 UTC
  • mfrom: (14047.3.6 pre-717969)
  • Revision ID: launchpad@pqm.canonical.com-20111001033538-vxdsv8ktrcy3ggte
[r=stub][bug=717969] DatabaseTransactionPolicy.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
# Copyright 2010 Canonical Ltd.  This software is licensed under the
 
1
# Copyright 2010-2011 Canonical Ltd.  This software is licensed under the
2
2
# GNU Affero General Public License version 3 (see the file LICENSE).
3
3
 
4
4
"""Ensure that some operations happen outside of transactions."""
8
8
    'check_no_transaction',
9
9
    'ensure_no_transaction',
10
10
    'is_transaction_in_progress',
 
11
    'TransactionInProgress',
11
12
    ]
12
13
 
13
14
from functools import wraps
21
22
    psycopg2.extensions.TRANSACTION_STATUS_ACTIVE: 'is active',
22
23
    psycopg2.extensions.TRANSACTION_STATUS_INTRANS: 'has started',
23
24
    psycopg2.extensions.TRANSACTION_STATUS_INERROR: 'has errored',
 
25
    psycopg2.extensions.TRANSACTION_STATUS_UNKNOWN: 'is in an unknown state',
24
26
    }
25
27
 
26
28