HEX
Server: Apache/2.4.52 (Ubuntu)
System: Linux spn-python 5.15.0-89-generic #99-Ubuntu SMP Mon Oct 30 20:42:41 UTC 2023 x86_64
User: arjun (1000)
PHP: 8.1.2-1ubuntu2.20
Disabled: NONE
Upload Files
File: //lib/python3/dist-packages/landscape/lib/__pycache__/store.cpython-310.pyc
o

y)�]��@s<dZzddlZWneyddlmZYnwdd�ZdS)z+Functions used by all sqlite-backed stores.�N)�dbapi2cs�fdd�}|S)a�Decorator that encloses the method in a database transaction.

    Even though SQLite is supposed to be useful in autocommit mode, we've
    found cases where the database continued to be locked for writing
    until the cursor was closed.  With this in mind, instead of using
    the autocommit mode, we explicitly terminate transactions and enforce
    cursor closing with this decorator.
    cs�|jst�|j�|_|��z%|j��}z�||g|�Ri|��}W|��n|��w|j��W|Sty@|j�	��w)N)
�_db�sqlite3�connect�	_filename�_ensure_schema�cursor�close�commit�
BaseException�rollback)�self�args�kwargsr�result��method��5/usr/lib/python3/dist-packages/landscape/lib/store.py�inners
�
�zwith_cursor.<locals>.innerr)rrrrr�with_cursor	s
r)�__doc__r�ImportError�	pysqlite2rrrrrr�<module>s�