SQLAlchemy で select for update を使用する完全な例を探していますが、グーグルで見つけられませんでした。単一の行をロックして列を更新する必要があります。次のコードは機能しません (永久にブロックされます)。
s = table.select(table.c.user=="test",for_update=True)
# Do update or not depending on the row
u = table.update().where(table.c.user=="test")
u.execute(email="foo")
コミットは必要ですか? それ、どうやったら出来るの?私が知る限り、あなたがする必要があるのは: begin transaction select ... for update update commit