Skip to content

Commit

Permalink
Merge pull request Pylons#1303 from flibustenet/patch-2
Browse files Browse the repository at this point in the history
More explicit example of set_property
  • Loading branch information
mmerickel committed Apr 17, 2014
2 parents b666df0 + 2af00e5 commit f8839af
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion docs/api/request.rst
Expand Up @@ -319,7 +319,13 @@
def _connect(request):
conn = request.registry.dbsession()
def cleanup(_):
def cleanup(request):
# since version 1.5 request.exception is not more
# eagerly cleared
if request.exception is not None:
conn.rollback()
else:
conn.commit()
conn.close()
request.add_finished_callback(cleanup)
return conn
Expand Down

0 comments on commit f8839af

Please sign in to comment.