PyMySQL Connection shared between processes

171 views
Skip to first unread message

Ondřej Vaverka

unread,
Nov 9, 2016, 5:45:38 AM11/9/16
to 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

unread,
Nov 9, 2016, 5:47:09 AM11/9/16
to 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>
Reply all
Reply to author
Forward
0 new messages