On Mon, Jun 25, 2018 at 6:24 PM, HP3 <[email protected]> wrote: > Thank you both > > With `before_cursor_execute` I am able to log each Connection, Cursor and > context instance. > > I see that every worker is doing its thing and the Connection instance is > always different for each SQL statement > > Also, each SQL has its own distinct > postgresql.psycopg2.PGExecutionContext_psycopg2 instance. > > However, I see that the "same" Cursor instance sometimes appears to be used > by different Workers. > > Does that make sense?
if those are two different processes then they aren't, they just happen to have the same id(). > > > [Worker-2] > [p2server.celery_tasks.generate_version(d3f81359-d969-4bdb-a30b-0f7a3c1c7fc1)] > p2server.celery_tasks BEFORE STMT <sqlalchemy.engine.base.Connection object > at 0x107e9afd0> <cursor object at 0x107f38048; closed: 0> 'INSERT INTO > p2baseversions ... RETURNING p2baseversions.id' > <sqlalchemy.dialects.postgresql.psycopg2.PGExecutionContext_psycopg2 object > at 0x107e9aef0> > > > [Worker-3] > [p2server.celery_tasks.generate_version(b8b7c166-a8e5-4a57-84c8-8d4990968f66)] > p2server.celery_tasks BEFORE STMT <sqlalchemy.engine.base.Connection object > at 0x107b2ce48> <cursor object at 0x107f38048; closed: 0> 'SELECT > p2baseversions.id ...' > <sqlalchemy.dialects.postgresql.psycopg2.PGExecutionContext_psycopg2 object > at 0x107e4d7f0> > > > > > > -- > SQLAlchemy - > The Python SQL Toolkit and Object Relational Mapper > > http://www.sqlalchemy.org/ > > To post example code, please provide an MCVE: Minimal, Complete, and > Verifiable Example. See http://stackoverflow.com/help/mcve for a full > description. > --- > You received this message because you are subscribed to the Google Groups > "sqlalchemy" group. > To unsubscribe from this group and stop receiving emails from it, send an > email to [email protected]. > To post to this group, send email to [email protected]. > Visit this group at https://groups.google.com/group/sqlalchemy. > For more options, visit https://groups.google.com/d/optout. -- SQLAlchemy - The Python SQL Toolkit and Object Relational Mapper http://www.sqlalchemy.org/ To post example code, please provide an MCVE: Minimal, Complete, and Verifiable Example. See http://stackoverflow.com/help/mcve for a full description. --- You received this message because you are subscribed to the Google Groups "sqlalchemy" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To post to this group, send email to [email protected]. Visit this group at https://groups.google.com/group/sqlalchemy. For more options, visit https://groups.google.com/d/optout.
