Database errors in Django when using threading

前端 未结 3 1275
小蘑菇
小蘑菇 2021-02-07 11:11

I am working in a Django web application which needs to query a PostgreSQL database. When implementing concurrency using Python threading interface, I am getting DoesNotEx

3条回答
  •  小鲜肉
    小鲜肉 (楼主)
    2021-02-07 11:50

    This sounds like it's an issue with transactions. If you're creating elements within the current request (or test), they're almost certainly in an uncommitted transaction that isn't accessible from the separate connection in the other thread. You probably need to manage your transctions manually to get this to work.

提交回复
热议问题