MySQL and Python: commits from one thread not visible to another thread, but visible from MySQL Workbench -


i have 2 python threads accessing same mysql database, each own connection , cursor object. 1 thread inserts record table. expect, mysql workbench, don't see table grow in length until writing thread commit, see change. problem is, other thread doesn't see change: sees old state of table, if commit never happened. when restart application, length of table read correctly, remains stuck there eternity, no matter how many records writing thread appends , commits. feel i'm missing obvious here.

to read length of table, i've tried: select count(*) mystupidtable select count(id) mystupidtable , even: select id mystupidtable

all these attempts return old state of table, though commit never happened.

it sounds 2nd thread running off snapshot of database when implicitly opened transaction. (which think cursors do.) if so, committing cursor on 2nd thread should allow see new data.

see https://dev.mysql.com/doc/refman/5.0/en/innodb-consistent-read.html , repeatable read level.


Comments

Popular posts from this blog

android - Gradle sync Error:Configuration with name 'default' not found -

java - Andrioid studio start fail: Fatal error initializing 'null' -

html - jQuery UI Sortable - Remove placeholder after item is dropped -