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 a0cd5f3
Show file tree
Hide file tree
Showing 2 changed files with 3 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
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ def test():
'run_dicom_archive_loader.py',
'--profile', 'database_config.py',
'--tarchive_path', '/data/loris/tarchive/DCM_2015-07-07_ImagingUpload-14-30-FoTt1K.tar',
'--verbose',
], capture_output=True)

# Print the standard output and error for debugging
Expand Down

0 comments on commit a0cd5f3

Please sign in to comment.