Dashboard
PHP:
8.2.30
OS:
Linux
User:
dh_nv8b2m
/
/
usr
/
local
/
lib
/
python3.10
/
dist-packages
/
sqlalchemy
/
engine
/
__pycache__
📤 Upload
📝 New File
📁 New Folder
Close
Editing: threadlocal.cpython-310.pyc
o [�h� � @ sL d Z ddlZddlmZ ddlmZ G dd� dej�ZG d d � d ej�ZdS )a8 Provides a thread-local transactional wrapper around the root Engine class. The ``threadlocal`` module is invoked when using the ``strategy="threadlocal"`` flag with :func:`~sqlalchemy.engine.create_engine`. This module is semi-private and is invoked automatically when the threadlocal engine strategy is used. � N� )�base� )�utilc s4 e Zd Z� fdd�Zdd� Zdd� Zdd� Z� ZS ) �TLConnectionc s t t| �j|i |�� d| _d S �Nr )�superr �__init__�_TLConnection__opencount)�self�arg�kw�� __class__� �H/usr/local/lib/python3.10/dist-packages/sqlalchemy/engine/threadlocal.pyr s zTLConnection.__init__c C s | j d7 _ | S �Nr )r �r r r r �_increment_connect s zTLConnection._increment_connectc C s( | j dkrtj�| � | j d8 _ d S r �r r � Connection�closer r r r r s zTLConnection.closec C s d| _ tj�| � d S r r r r r r �_force_close$ s zTLConnection._force_close)�__name__� __module__�__qualname__r r r r � __classcell__r r r r r s r c s� e Zd ZdZeZe�dd�� fdd��Zdd� Z dd � Z d#dd�Zd d� Zdd� Z dd� Zdd� Zdd� Zdd� Zdd� Z� fdd�Zedd� �Zdd � Zd!d"� Z� ZS )$�TLEnginezPAn Engine that includes support for thread-local managed transactions. z1.3a The 'threadlocal' engine strategy is deprecated, and will be removed in a future release. The strategy is no longer relevant to modern usage patterns (including that of the ORM :class:`.Session` object) which make use of a :class:`.Connection` object in order to invoke statements.c s&