Documentation Home
MySQL Connector/Python Developer Guide
Related Documentation Download this Manual
PDF (US Ltr) - 0.6Mb
PDF (A4) - 0.6Mb
EPUB - 136.4Kb
HTML Download (TGZ) - 85.5Kb
HTML Download (Zip) - 103.3Kb


MySQL Connector/Python Developer Guide  /  ...  /  MySQLConnection.in_transaction Property

10.2.42 MySQLConnection.in_transaction Property

This property returns True or False to indicate whether a transaction is active for the connection. The value is True regardless of whether you start a transaction using the start_transaction() API call or by directly executing a SQL statement such as START TRANSACTION or BEGIN.


>>> cnx.start_transaction()
>>> cnx.in_transaction
True
>>> cnx.commit()
>>> cnx.in_transaction
False

in_transaction was added in MySQL Connector/Python 1.1.0.


User Comments
Sign Up Login You must be logged in to post a comment.