Menu

#80 no insert of records in db, no commit

closed-fixed
MySQL (29)
5
2005-06-14
2005-04-17
Anonymous
No

WinXPSP2; Python 2.4.1; MySQLdb 1.2.0; SQLObject 0.6.1

Following examples noted that no records are actually
inserted into MySQL db, even though autoincrement
increased and no errors are reported.

Tried some tests with MySQLdb alone and found same
issue. Searched Google and found that some releases of
MySQLdb have autocommit set to false by default. Adding
connection.autocommit(True) to MySQLdb example code
resolved the issue.

Made the following change to mysqlconnection.py at line 28:

def makeConnection(self):
conn = MySQLdb.connect(host=self.host, db=self.db,
user=self.user,
passwd=self.password)
conn.autocommit(True) # DPG2 20050416: required
for \ some versions of MySQLdb
return conn

Thanks for SQLObject!

Discussion

  • Oleg Broytman

    Oleg Broytman - 2005-05-26

    Logged In: YES
    user_id=4799

    I think this was fixed in the Subversion long ago. Please
    verify.

     
  • Oleg Broytman

    Oleg Broytman - 2005-05-26
    • assigned_to: nobody --> phd
     
  • Oleg Broytman

    Oleg Broytman - 2005-06-14
    • status: open --> closed-fixed
     

Log in to post a comment.