aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorArun Isaac2022-09-28 13:37:10 +0530
committerArun Isaac2022-09-28 13:37:10 +0530
commit361b016764205845b8175100fe21a5455968c087 (patch)
tree2d89bdba5892afbb886d9fbd922c645aa401c532
parent176aaf2d1a5891242029ca4ebcfea287050fd7ed (diff)
downloadgenenetwork2-361b016764205845b8175100fe21a5455968c087.tar.gz
Do not assume transactions in database connections.
Not all database queries need transactions. If transactions are required, they should be made a separate context manager and called only when required. * wqflask/wqflask/database.py (database_connection): Do not rollback or commit.
-rw-r--r--wqflask/wqflask/database.py5
1 files changed, 0 insertions, 5 deletions
diff --git a/wqflask/wqflask/database.py b/wqflask/wqflask/database.py
index d392f1d1..84c494c5 100644
--- a/wqflask/wqflask/database.py
+++ b/wqflask/wqflask/database.py
@@ -59,11 +59,6 @@ def database_connection() -> Iterator[Connection]:
)
try:
yield connection
- except Exception:
- connection.rollback()
- raise
- else:
- connection.commit()
finally:
connection.close()