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
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