Rollback a transaction on failure, if there is one.

This commit is contained in:
Ralph Bean
2016-10-19 10:26:14 -04:00
parent e35f7af7a0
commit 1666c1c57e

View File

@@ -81,6 +81,8 @@ def make_session(conf):
yield session
session.commit()
except:
# This is a no-op if no transaction is in progress.
session.rollback()
raise
finally:
session.close()