MySQL Forums
Forum List  »  Connector/Python

transactions in python mysql connector
Posted by: Jeffrey Blayney
Date: May 05, 2014 11:03AM

Hey all,

I'm pretty confused, I hope someone can help me.

On this page, it explains how to insert data using the python connector:

http://dev.mysql.com/doc/connector-python/en/connector-python-example-cursor-transaction.html

This page does not make use of the start_transaction method, even though the post states that autocommit is disabled for this example: https://dev.mysql.com/doc/connector-python/en/connector-python-api-mysqlconnection-start-transaction.html

Does the execute() method start a transaction?

When I try running an INSERT and then a COMMIT from the command line tool, the COMMIT says '0 rows affected'. I assume this is because I didn't start a transaction. Is the documentation above regarding inserting data with the connector missing the call to start_transaction()?

Thanks for any help!

-Jeff

Options: ReplyQuote


Subject
Written By
Posted
transactions in python mysql connector
May 05, 2014 11:03AM


Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.