aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--scripts/load_phenotypes_to_db.py5
1 files changed, 3 insertions, 2 deletions
diff --git a/scripts/load_phenotypes_to_db.py b/scripts/load_phenotypes_to_db.py
index 9721263..c034212 100644
--- a/scripts/load_phenotypes_to_db.py
+++ b/scripts/load_phenotypes_to_db.py
@@ -305,6 +305,7 @@ if __name__ == "__main__":
setup_logging(args.log_level.upper())
with (mysqldb.database_connection(args.db_uri) as conn,
+ conn.cursor(cursorclass=DictCursor) as cursor,
sqlite3.connection(args.jobs_db_path) as jobs_conn):
# Lock the PublishXRef/PublishData/PublishSE/NStrain here: Why?
# The `DataId` values are sequential, but not auto-increment
@@ -320,7 +321,7 @@ if __name__ == "__main__":
"PublishData",
"PublishSE",
"NStrain")
- conn.execute(# Lock the tables to avoid race conditions
+ cursor.execute(# Lock the tables to avoid race conditions
"LOCK TABLES "
"PublishXRef WRITE, "
"PublishData WRITE, "
@@ -336,7 +337,7 @@ if __name__ == "__main__":
stack_info=True)
logger.debug("Unlocking all database tables.")
- conn.execute("UNLOCK TABLES")
+ cursor.execute("UNLOCK TABLES")
return 1