diff options
author | Arun Isaac | 2022-09-28 13:37:10 +0530 |
---|---|---|
committer | Arun Isaac | 2022-09-28 13:37:10 +0530 |
commit | 361b016764205845b8175100fe21a5455968c087 (patch) | |
tree | 2d89bdba5892afbb886d9fbd922c645aa401c532 /wqflask | |
parent | 176aaf2d1a5891242029ca4ebcfea287050fd7ed (diff) | |
download | genenetwork2-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.
Diffstat (limited to 'wqflask')
-rw-r--r-- | wqflask/wqflask/database.py | 5 |
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() |