Skip to content

Commit

Permalink
try fix
Browse files Browse the repository at this point in the history
  • Loading branch information
maximemulder committed Dec 17, 2024
1 parent 8bc17a6 commit 8bf736f
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions python/lib/database.py
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,8 @@ def connect(self):
user=self.user_name,
passwd=self.password,
port=self.port,
db=self.db_name
db=self.db_name,
autocommit=True,
)
# self.cnx.cursor = self.cnx.cursor(prepared=True)
except MySQLdb.Error as err:
Expand Down Expand Up @@ -178,7 +179,6 @@ def insert(self, table_name, column_names, values, get_last_id=False):
else:
# else, values is a tuple and want to execute only one insert
cursor.execute(query, values)
self.con.commit()
last_id = cursor.lastrowid
cursor.close()
except MySQLdb.Error as err:
Expand Down Expand Up @@ -206,7 +206,6 @@ def update(self, query, args):
try:
cursor = self.con.cursor()
cursor.execute(query, args)
self.con.commit()
except MySQLdb.Error as err:
raise Exception("Update query failure: " + format(err))

Expand Down

0 comments on commit 8bf736f

Please sign in to comment.