diff --git a/python/lib/database.py b/python/lib/database.py index ad0b3d91a..de80fa64f 100644 --- a/python/lib/database.py +++ b/python/lib/database.py @@ -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: @@ -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: @@ -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)) diff --git a/python/tests/integration/scripts/test_run_dicom_archive_loader.py b/python/tests/integration/scripts/test_run_dicom_archive_loader.py index 66dc74d06..5544f6199 100644 --- a/python/tests/integration/scripts/test_run_dicom_archive_loader.py +++ b/python/tests/integration/scripts/test_run_dicom_archive_loader.py @@ -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