hooks/integrity.py
changeset 10893 351c82df25be
parent 10689 49a62b8f6d43
child 10907 9ae707db5265
equal deleted inserted replaced
10892:f0bb16be11d0 10893:351c82df25be
    45 def _acquire_unique_cstr_lock(cnx):
    45 def _acquire_unique_cstr_lock(cnx):
    46     """acquire the _UNIQUE_CONSTRAINTS_LOCK for the cnx.
    46     """acquire the _UNIQUE_CONSTRAINTS_LOCK for the cnx.
    47 
    47 
    48     This lock used to avoid potential integrity pb when checking
    48     This lock used to avoid potential integrity pb when checking
    49     RQLUniqueConstraint in two different transactions, as explained in
    49     RQLUniqueConstraint in two different transactions, as explained in
    50     http://intranet.logilab.fr/jpl/ticket/36564
    50     https://extranet.logilab.fr/3577926
    51     """
    51     """
    52     if 'uniquecstrholder' in cnx.transaction_data:
    52     if 'uniquecstrholder' in cnx.transaction_data:
    53         return
    53         return
    54     _UNIQUE_CONSTRAINTS_LOCK.acquire()
    54     _UNIQUE_CONSTRAINTS_LOCK.acquire()
    55     cnx.transaction_data['uniquecstrholder'] = True
    55     cnx.transaction_data['uniquecstrholder'] = True