示例#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
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()