开发者

How to use database connection in threads?

I 开发者_StackOverflowwant to use standard database connections in threads. Is it thread-safe?


Depends on the particular database implementation you are using. If the module conforms to the Python Database API Specification v2.0, it should have the threadsafety global that will let you know what can be shared between processes and what not. I guess if it is not 0, you can multi-thread at least some of your DB code.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜