python - mysql issue while using concurrent.futures -
my code follows. for in self.parent_job.child_jobs: futures.append(executor.submit(invokeruncommand, i)) future in concurrent.futures.as_completed(futures): print("future exception: %s" %future.exception()) executor.shutdown(wait="true") def invokeruncommand(self): db_connect, db_cur = connect_to_database_pl() self.setjobstatus(db_cur, job_running) ... def setjobstatus(self, db_cur, job_status, run_status=run_passed): self.job_status = job_status sql = """update jobs set job_status=%d job_id=%d""" \ %(job_status, self.job_id) db_cur.execute(sql) def connect_to_database_pl(dict_cursor=1): database = sql_db db_users = { 'employee' : {'user' : 'test', 'password' : 'test123'}, } user = db_users[database]['user'] password = db_users[database]['password'] try: ...