Python's MySqlDB not getting updated row

后端 未结 2 504
庸人自扰
庸人自扰 2020-12-03 08:12

I have a script that waits until some row in a db is updated:

con = MySQLdb.connect(server, user, pwd, db)

When the script starts the row\'

2条回答
  •  被撕碎了的回忆
    2020-12-03 09:15

    I worked around this by running

    c.execute("""set session transaction isolation level READ COMMITTED""")
    

    early on in my reading session. Updates from other threads do come through now.

    In my instance I was keeping connections open for a long time (inside mod_python) and so updates by other processes weren't being seen at all.

提交回复
热议问题