def session_clear(exception=None): """ Resolve database session issues for the combination of Postgres/Sqlalchemy to rollback database transactions after an exception is thrown. """ db.remove() if exception and db.is_active: db.rollback()
def on_finish(self): db.remove()
def close_data_base(exception=None): if exception is not None: print('+++++++' + str(exception) + '+++++++') if db is not None: db.remove()
def teardown_request(exception=None): if db is not None: db.remove()
def shutdown_session(exception=None): db.remove()
def close_db(exception=None): if exception is not None: print("++++" + str(exception) + "++++") db.remove()
def teardown_db(exception=None): db.remove()
def close_db(exception=None): if db is not None: db.remove()