sqlalchemy lock row code example
Example: sqlalchemy lock row
YourModel.query.with_for_update().get(id)
#This locks the row until
db.session.rollback()
#or
db.session.commit()
#is called
YourModel.query.with_for_update().get(id)
#This locks the row until
db.session.rollback()
#or
db.session.commit()
#is called