About refreshing objects in sqlalchemy session

前端 未结 4 801
醉话见心
醉话见心 2021-02-01 04:11

Well, I am dealing with a doubt about sqlalchemy and objects refreshing!

I am in the situation in what I have 2 sessions, and the same object has been queried in both se

4条回答
  •  长情又很酷
    2021-02-01 04:34

    Run this, to force session to update latest value from your database of choice:

    session.expire_all()
    

    Excellent DOC about default behavior and lifespan of session

提交回复
热议问题