commit database transaction on on_end_request
commit database transaction on on_end_request

because for streaming (e.g. generators) the code might be run after on_end_resource

opmuse/opmuse,opmuse/opmuse,opmuse/opmuse,opmuse/opmuse