PyMySQL Connection shared between processes

瀏覽次數:171 次
跳到第一則未讀訊息

Ondřej Vaverka

未讀,
2016年11月9日 清晨5:45:382016/11/9
收件者:PyMySQL Users
Hello,

how I can use one pymysql connection object in two processes created by Python 3 multiprocessing module? At first the main process creates database connection object (global) and tries keep this connection alive, then child process is spawned and uses this connection object (does queries). But it seems that connection object is forked somewhere. Could you please help?

INADA Naoki

未讀,
2016年11月9日 清晨5:47:092016/11/9
收件者:pymysq...@googlegroups.com
You can't.
Each process should create own connection.
> --
> You received this message because you are subscribed to the Google Groups
> "PyMySQL Users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to pymysql-user...@googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.



--
INADA Naoki <songof...@gmail.com>
回覆所有人
回覆作者
轉寄
0 則新訊息