server/rest: rollback session on query exception
Kills complaints from sqlalchemy when an error happens during insertion/update hook.
This commit is contained in:
parent
07d0b43d4c
commit
af6c35ed6b
|
@ -93,6 +93,9 @@ def application(env, start_response):
|
|||
hook(ctx)
|
||||
try:
|
||||
response = handler(ctx, match.groupdict())
|
||||
except:
|
||||
ctx.session.rollback()
|
||||
raise
|
||||
finally:
|
||||
for hook in middleware.post_hooks:
|
||||
hook(ctx)
|
||||
|
|
Loading…
Reference in New Issue