will leak database sessions as the implementation of "f" will only be
invoked from the for-loop. However at this time the "finally" block
closing the session has already run. SQLAlchemy will helpfully reopen
the session, but it will not be closed in the end.