I\'m looking for a complete example of using select for update in SQLAlchemy, but haven\'t found one googling. I need to lock a single row and update a column, the followin
If you are using the ORM, try the with_for_update function:
foo = session.query(Foo).filter(Foo.id==1234).with_for_update().one()
# this row is now locked
foo.name = 'bar'
session.add(foo)
session.commit()
# this row is now unlocked