diff options
author | René 'Necoro' Neumann <necoro@necoro.net> | 2012-01-10 22:01:37 +0100 |
---|---|---|
committer | René 'Necoro' Neumann <necoro@necoro.net> | 2012-01-10 22:01:37 +0100 |
commit | a5c0cd1a0f496325035fbd3f3cbb8b81e7648301 (patch) | |
tree | 50cf8500662a618b2c2d2ff7122cec5b69e50186 /index.py | |
parent | 77817e08eb237c207cc93d9545c61fb30e0059a9 (diff) | |
download | kosten-a5c0cd1a0f496325035fbd3f3cbb8b81e7648301.tar.gz kosten-a5c0cd1a0f496325035fbd3f3cbb8b81e7648301.tar.bz2 kosten-a5c0cd1a0f496325035fbd3f3cbb8b81e7648301.zip |
Fix bug that prevents closing sql-connections
Diffstat (limited to 'index.py')
-rwxr-xr-x | index.py | 13 |
1 files changed, 7 insertions, 6 deletions
@@ -24,18 +24,19 @@ urls = ( # ORM # def handle_sql(handler): - web.ctx.orm = session = model.session + web.ctx.orm = model.session try: - return handler() + h = handler() except web.HTTPError: - session.commit() - raise + web.ctx.orm.commit() + raise except: - session.rollback() + web.ctx.orm.rollback() raise else: - session.commit() + web.ctx.orm.commit() + return h # # The App |