Documentation Home
Connectors and APIs Manual
Download this Manual 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 an SQL statement such as START TRANSACTION or BEGIN.

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

in_transaction was added in MySQL Connector/Python 1.1.0.

User Comments
User comments in this section are, as the name implies, provided by MySQL users. The MySQL documentation team is not responsible for, nor do they endorse, any of the information provided here.
Sign Up Login You must be logged in to post a comment.