コード例 #1
0
ファイル: dao_transaction.py プロジェクト: sgiroux/trex
    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()
コード例 #2
0
ファイル: __init__.py プロジェクト: sgiroux/trex
def dispose():
    """
        Disposes the system
    """
    close_db_connection()