diff options
Diffstat (limited to 'gn3')
-rw-r--r-- | gn3/db_utils.py | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/gn3/db_utils.py b/gn3/db_utils.py index 2f65a33..5fd250d 100644 --- a/gn3/db_utils.py +++ b/gn3/db_utils.py @@ -35,7 +35,10 @@ def database_connection(sql_uri) -> Iterator[Connection]: port=port or 3306) try: yield connection + except mdb.Error as _mbde: + connection.rollback() finally: + connection.commit() connection.close() |