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

    if db is not None:
        db.remove()
Exemple #4
0
def teardown_request(exception=None):
    if db is not None:
        db.remove()
Exemple #5
0
def shutdown_session(exception=None):
    db.remove()
Exemple #6
0
def close_db(exception=None):
    if exception is not None:
        print("++++" + str(exception) + "++++")
    db.remove()
Exemple #7
0
def teardown_db(exception=None):
    db.remove()
 def on_finish(self):
     db.remove()
Exemple #9
0
def close_db(exception=None):
    if db is not None:
        db.remove()