예제 #1
0
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()
예제 #2
0
 def on_finish(self):
     db.remove()
예제 #3
0
def close_data_base(exception=None):
    if exception is not None:
        print('+++++++' + str(exception) + '+++++++')

    if db is not None:
        db.remove()
예제 #4
0
def teardown_request(exception=None):
    if db is not None:
        db.remove()
예제 #5
0
파일: __init__.py 프로젝트: ungarst/p4p_svr
def shutdown_session(exception=None):
    db.remove()
예제 #6
0
def close_db(exception=None):
    if exception is not None:
        print("++++" + str(exception) + "++++")
    db.remove()
예제 #7
0
def teardown_db(exception=None):
    db.remove()
예제 #8
0
 def on_finish(self):
     db.remove()
예제 #9
0
def close_db(exception=None):
    if db is not None:
        db.remove()