Hacked By AnonymousFox

Current Path : /opt/cloudlinux/venv/lib64/python3.11/site-packages/sqlalchemy/engine/__pycache__/
Upload File :
Current File : //opt/cloudlinux/venv/lib64/python3.11/site-packages/sqlalchemy/engine/__pycache__/threadlocal.cpython-311.pyc

�

�܋f���v�dZddlZddlmZddlmZGd�dej��ZGd	�d
ej��ZdS)a8Provides 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�0��eZdZ�fd�Zd�Zd�Zd�Z�xZS)�TLConnectionc�V��tt|��j|i|��d|_dS�Nr)�superr�__init__�_TLConnection__opencount)�self�arg�kw�	__class__s   ��T/opt/cloudlinux/venv/lib64/python3.11/site-packages/sqlalchemy/engine/threadlocal.pyrzTLConnection.__init__s3���*��l�D�!�!�*�C�6�2�6�6�6������c�&�|xjdz
c_|S�Nr)r
�rs r�_increment_connectzTLConnection._increment_connects�����A�����rc�z�|jdkrtj�|��|xjdzc_dSr�r
r�
Connection�closers rrzTLConnection.closes@����q� � ��O�!�!�$�'�'�'����A�����rc�R�d|_tj�|��dSr
rrs r�_force_closezTLConnection._force_close$s&���������d�#�#�#�#�#r)�__name__�
__module__�__qualname__rrrr�
__classcell__�rs@rrrse������������������
$�$�$�$�$�$�$rrc���eZdZdZeZejdd���fd���Zd�Z	d�Z
dd�Zd	�Zd
�Z
d�Zd�Zd
�Zd�Zd�Z�fd�Zed���Zd�Zd�Z�xZS)�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:`_engine.Connection` object in order to invoke statements.c���tt|��j|i|��tj���|_dS�N)rr$rr�	threading�local�_connections)r�args�kwargsrs   �rrzTLEngine.__init__1sC���	'��h����&��7��7�7�7� �N�0�0�2�2����rc��|jdi|��S)N�)�_contextual_connect)rrs  r�contextual_connectzTLEngine.contextual_connect>s��'�t�'�-�-�"�-�-�-rc�4�t|jd��sd}n|j���}|�|jrK|j||�|jj|��fi|��}tj	|��|j_|�
��S�N�conn)�hasattrr)r2�closed�_tl_connection_cls�_wrap_pool_connect�pool�connect�weakref�refr)rr�
connections   rr.zTLEngine._contextual_connectAs����t�(�&�1�1�	2��J�J��*�/�/�1�1�J����!2��1��0���'�'��	�(9�:�F�F������J�
&-�[��%<�%<�D��"��,�,�.�.�.rNc���t|jd��sg|j_|jj�|����|�����|S)N�trans)�xid)r3r)r=�appendr.�begin_twophase)rr>s  rr@zTLEngine.begin_twophaseSsg���t�(�'�2�2�	)�&(�D��#����&�&��$�$�&�&�5�5�#�5�>�>�	
�	
�	
��rc���t|jd��sg|j_|jj�|��������|S�Nr=)r3r)r=r?r.�begin_nestedrs rrCzTLEngine.begin_nested[sb���t�(�'�2�2�	)�&(�D��#����&�&��$�$�&�&�3�3�5�5�	
�	
�	
��rc���t|jd��sg|j_|jj�|��������|SrB)r3r)r=r?r.�beginrs rrEzTLEngine.begincsY���t�(�'�2�2�	)�&(�D��#����&�&�t�'?�'?�'A�'A�'G�'G�'I�'I�J�J�J��rc��|Sr&r-rs r�	__enter__zTLEngine.__enter__is���rc�^�|�|���dS|���dSr&)�commit�rollback)r�type_�value�	tracebacks    r�__exit__zTLEngine.__exit__ls)���=��K�K�M�M�M�M�M��M�M�O�O�O�O�Orc��t|jd��r|jjsdS|jjd���dS�Nr=���)r3r)r=�preparers rrRzTLEngine.preparersO����)�7�3�3�	��$�*�	�
�F�����#�+�+�-�-�-�-�-rc��t|jd��r|jjsdS|jj�d��}|���dSrP)r3r)r=�poprI�rr=s  rrIzTLEngine.commitzsV����)�7�3�3�	��$�*�	�
�F��!�'�+�+�B�/�/��
�������rc��t|jd��r|jjsdS|jj�d��}|���dSrP)r3r)r=rTrJrUs  rrJzTLEngine.rollback�s[����)�7�3�3�	��$�*�	�
�F��!�'�+�+�B�/�/��
�������rc���tj���|_t	t
|�����dSr&)rr'r(r)rr$�dispose)rrs �rrXzTLEngine.dispose�s;��� �N�0�0�2�2���
�h����%�%�'�'�'�'�'rc��t|jd��p8|j���dup|j���jSr1)r3r)r2r4rs rr4zTLEngine.closed�sR����)�6�2�2�2�
/�� �%�%�'�'�4�/�
/�� �%�%�'�'�.�	
rc���|jsh|������|j���}|���|j`g|j_dSdSr&)r4r.rr)r2rr=)rr;s  rrzTLEngine.close�st���{�	)��$�$�&�&�,�,�.�.�.��*�/�/�1�1�J��#�#�%�%�%��!�&�&(�D��#�#�#�	)�	)rc��d|jzS)NzTLEngine(%r))�urlrs r�__repr__zTLEngine.__repr__�s�����(�(rr&)rrr �__doc__rr5r�
deprecatedrr/r.r@rCrErGrNrRrIrJrX�propertyr4rr]r!r"s@rr$r$)sZ���������
&���T�_�
�	0���3�3�3�3���3�.�.�.�/�/�/�$����������������.�.�.�������(�(�(�(�(��
�
��X�
�)�)�)�)�)�)�)�)�)�)rr$)	r^r9�rrrr�Enginer$r-rr�<module>rcs���������������������$�$�$�$�$�4�?�$�$�$�&x)�x)�x)�x)�x)�t�{�x)�x)�x)�x)�x)r

Hacked By AnonymousFox1.0, Coded By AnonymousFox