RE: MySQL connector issue

2016-10-23 Thread Joseph L. Casale
> Interesting. Generally, I allocate cursors exactly at the same time as I open > transactions; > not sure if this works with the mysql connector, but with psycopg2 > (PostgreSQL), my code looks like this: > > with conn, conn.cursor() as cur: > cur.execute(...) > ... = cur.fetchall() > >

Re: MySQL connector issue

2016-10-23 Thread Chris Angelico
On Mon, Oct 24, 2016 at 3:46 AM, Joseph L. Casale wrote: > It really is that simple which is why I am baffled. Given the throughput is so > low, if I close the cursor and connection at the end of loop and instantiate > them > both at the start of the loop, it works as expected but that's obviousl

RE: MySQL connector issue

2016-10-23 Thread Joseph L. Casale
> Perhaps you simplified too much, but changes between the select and the > update could be lost. I think you need at least three states: > > 1 mark rows where baz is null (by setting baz to some value other than NULL > or 42, 24, say: set baz = 24 where baz is NULL) > 2 show marked rows (select

Re: MySQL connector issue

2016-10-23 Thread Peter Otten
Joseph L. Casale wrote: > I have some code that I am testing on Windows without c extensions which > runs on a RHEL server with c extensions. In a simplified test case as > follows: > > connection = mysql.connector.connect(...) > cursor = connection.cursor(cursor_class=MySQLCursorDict) > while Tr