Bug #79991 start_transaction() not implemented in Python Conenctor
Submitted: 14 Jan 2016 20:24 Modified: 14 Aug 2017 11:36
Reporter: Matthew Boehm Email Updates:
Status: No Feedback Impact on me:
Category:Connector / Python Severity:S3 (Non-critical)
Version: OS:Any
Assigned to: Assigned Account CPU Architecture:Any

[14 Jan 2016 20:24] Matthew Boehm

=== BEGIN ===
import mysql.connector
from mysql.connector import fabric

# Address of the Fabric, not the host we are going to connect to.
conn = mysql.connector.connect(
    fabric={"host" : "localhost", "port" : 32274,
            "username": "admin", "password" : "admin1"
    user="fabricapp", password="fabricapp1", database="test", autocommit=False

cur = conn.cursor()
cur.execute("INSERT INTO test.authors (authorId, name) VALUES (123, 'Bob')")
=== END ===

[root@ip-172-30-3-220 ~]# python transaction.py
Traceback (most recent call last):
  File "transaction.py", line 12, in <module>
  File "/usr/lib/python2.7/site-packages/mysql/connector/fabric/connection.py", line 1272, in __getattr__
    return getattr(self._mysql_cnx, attr)
AttributeError: 'NoneType' object has no attribute 'start_transaction'

How to repeat:
See above sample code

Suggested fix:
Properly implement according to the documentation.
[18 Jan 2016 12:23] Paulo Jesus
This issue belongs to the Connector/Python category, not MySQL Fabric.
Category changed.
[14 Jul 2017 11:32] Nuno Mariz
Hi Matthew,
The connection is invalid, the conn variable is None, that's why it doesn't have  the 'start_transaction' method.
Can you please check if you are providing the correct connection values?
[15 Aug 2017 1:00] Bugs System
No feedback was provided for this bug for over a month, so it is
being suspended automatically. If you are able to provide the
information that was originally requested, please do so and change
the status of the bug back to "Open".