hyb
2025-11-18 7539e6f48c75dcaeb808359cccfd1c0d0d182ce8
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
Ë
Wñúh—ãóX—dZddlmZddlmZddlmZddlmZededeefd„«Z    y    )
z×Atomic transaction context manager utilities for MySQL Connector/Python.
 
Provides context manager atomic_transaction() that ensures commit on success
and rollback on error without obscuring the original exception.
é)Úcontextmanager)ÚIterator)ÚMySQLConnectionAbstract)ÚMySQLCursorAbstractÚconnÚreturnc#ó˜K—|j}|j«}d}    |rd|_|–—|j«    ||_    |j «y#t$r$d}    |j    «‚#t$rY‚wxYwwxYw#t$r|s‚YywxYw#||_    |j «w#t$r|s‚YwwxYwxYw­w)a 
    Context manager that wraps a MySQL database cursor and ensures transaction
    rollback in case of exception.
 
    NOTE: DDL statements such as CREATE TABLE cause implicit commits. These cannot
    be managed by a cursor object. Changes made at or before a DDL statement will
    be committed and not rolled back. Callers are responsible for any cleanup of
    this type.
 
    This class acts as a robust, PEP 343-compliant context manager for handling
    database cursor operations on a MySQL connection. It ensures that all operations
    executed within the context block are part of the same transaction, and
    automatically calls `connection.rollback()` if an exception occurs, helping
    to maintain database integrity. On normal completion (no exception), it simply
    closes the cursor after use. Exceptions are always propagated to the caller.
 
    Args:
        conn: A MySQLConnectionAbstract instance.
    FTN)Ú
autocommitÚcursorÚcommitÚ    ExceptionÚrollbackÚclose)rÚold_autocommitr Úexception_raiseds    úOH:\Change_password\venv_build\Lib\site-packages\mysql/ai/utils/atomic_cursor.pyÚatomic_transactionr*säèø€ð.—_‘_€NØ [‰[‹]€FàÐðÙ Ø#ˆDŒOàŠ à  ‰  ð)ˆŒð    Ø L‰LNøô ò    ØÐð    Ø M‰MŒOð     øô ò    à ð    ð     úð        ûôò    á#Øñ$ð    ûð    )ˆŒð    Ø L‰LNøÜò    á#Øñ$ð    ÿs”‚C
¢AÁC
ÁB    ÁC
Á BÁ%A6Á5BÁ6    BÁ?BÂBÂBÂB     BÂC
ÂBÂC
ÂCÂ$B5Â4CÂ5 CÃCÃCÃCÃC
N)
Ú__doc__Ú
contextlibrÚtypingrÚmysql.connector.abstractsrÚmysql.connector.cursorrr©órú<module>rsBðñ:õ &Ýå=Ý6ðð3Ø
!ð3à Ð!Ñ"ò3óñ3r