@wraps(f)
def go(*args, **kw):
    try:
        ret = f(*args, **kw)
        db.commit()
        return ret
    except:
        db.rollback()
        db.close()
        raise
@wraps(f)
def go(*args, **kw):
    try:
        ret = f(*args, **kw)
        db.commit()
        return ret
    except:
        db.rollback()
        db.close()
        raise