vdZddlZddlmZddlmZGddejZGd d ejZdS) 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)utilc0eZdZfdZdZdZdZxZS) TLConnectioncVtt|j|i|d|_dSNr)superr__init___TLConnection__opencount)selfargkw __class__s /srv/buildsys-work-dir/castor/build_node/builder-2/WGSG1/unpkd_srcs/cloudlinux-venv-1.0.6/venv/lib/python3.11/site-packages/sqlalchemy/engine/threadlocal.pyr zTLConnection.__init__s3*lD!!*C62666c&|xjdz c_|SNr)r rs r_increment_connectzTLConnection._increment_connects A rcz|jdkrtj||xjdzc_dSrr r Connectionclosers rrzTLConnection.closes@  q O ! !$ ' ' ' ArcRd|_tj|dSr rrs r _force_closezTLConnection._force_close$s& d#####r)__name__ __module__ __qualname__r rrr __classcell__rs@rrrse $$$$$$$rrceZdZdZeZejddfdZdZ dZ ddZ d Z d Z d Zd Zd ZdZdZfdZedZdZdZxZS)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.ctt|j|i|tj|_dSN)r r$r r threadinglocal _connections)rargskwargsrs rr zTLEngine.__init__1sC 'h&7777 N0022rc |jdi|S)N)_contextual_connect)rrs rcontextual_connectzTLEngine.contextual_connect>s't'--"---rc 4t|jdsd}n|j}||jrK|j|||jj|fi|}tj ||j_| SNconn) hasattrr)r2closed_tl_connection_cls_wrap_pool_connectpoolconnectweakrefrefr)rr connections rr.zTLEngine._contextual_connectAst(&11 2JJ*//11J  !2 10'' (9:FFJ &-[%<%s rr@zTLEngine.begin_twophaseSsgt('22 )&(D  # &&  $ $ & & 5 5# 5 > >    rct|jds g|j_|jj||SNr=)r3r)r=r?r. begin_nestedrs rrCzTLEngine.begin_nested[sbt('22 )&(D  # &&  $ $ & & 3 3 5 5    rct|jds g|j_|jj||SrB)r3r)r=r?r.beginrs rrEzTLEngine.begincsYt('22 )&(D  # &&t'?'?'A'A'G'G'I'IJJJ rc|Sr&r-rs r __enter__zTLEngine.__enter__is rc^||dS|dSr&)commitrollback)rtype_value tracebacks r__exit__zTLEngine.__exit__ls) = KKMMMMM MMOOOOOrct|jdr |jjsdS|jjddSNr=)r3r)r=preparers rrRzTLEngine.preparersO)733 $*  F #++-----rct|jdr |jjsdS|jjd}|dSrP)r3r)r=poprIrr=s rrIzTLEngine.commitzsV)733 $*  F!'++B// rct|jdr |jjsdS|jjd}|dSrP)r3r)r=rTrJrUs rrJzTLEngine.rollbacks[)733 $*  F!'++B// rctj|_t t |dSr&)rr'r(r)r r$dispose)rrs rrXzTLEngine.disposes; N0022 h%%'''''rct|jd p8|jdup|jjSr1)r3r)r2r4rs rr4zTLEngine.closedsR)622 2 / %%''4/ / %%''. rc|jsh||j}||j`g|j_dSdSr&)r4r.rr)r2rr=)rr;s rrzTLEngine.closest{ )  $ $ & & , , . . .*//11J  # # % % %!&&(D  # # #  ) )rcd|jzS)Nz TLEngine(%r))urlrs r__repr__zTLEngine.__repr__s((rr&)rrr __doc__rr5r deprecatedr r/r.r@rCrErGrNrRrIrJrXpropertyr4rr]r!r"s@rr$r$)sZ &T_  033333...///$  ...(((((  X ))))))))))rr$) r^r9rrrrEnginer$r-rrrcs$$$$$4?$$$&x)x)x)x)x)t{x)x)x)x)x)r