관리-도구
편집 파일: threadlocal.cpython-37.pyc
B ��4]� � @ 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||� d| _d S )Nr )�superr �__init__�_TLConnection__opencount)�self�arg�kw)� __class__� �P/opt/alt/python37/lib64/python3.7/site-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 )Nr )r r � Connection�close)r r r r r s zTLConnection.closec C s d| _ tj�| � d S )Nr )r r 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"