Example #1
0
    def process_response(self, req, resp, resource):
        """
            Post-processing of the response (after routing).

            :param req: The request
            :type req: falcon.Request

            :param resp: The response
            :type resp: falcon.Response
        """
        if resp.status in DAOTransaction.__OK_STATUSES:
            AbstractDAO.commit()
        else:
            assert resp.status not in DAOTransaction.__OK_STATUSES
            AbstractDAO.rollback()

        # close the session
        close_db_connection()
Example #2
0
def dispose():
    """
        Disposes the system
    """
    close_db_connection()