Does MySQLdb use any type of internal caching? I'm having a weird problem where if I change rows in the database, I don't see the newly inserted rows within python.
I use something similar to this..
c = sql.cursor()
c.execute("SELECT * from A")
rows = c.fetchall()
for cur in rows:
print cur[0]
c.close()
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
FYI, auto-commit is off by default in MySQLdb (and all other python DB libs that follow PEP 249). If you want auto-commit, specify it at connect() time.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Does MySQLdb use any type of internal caching? I'm having a weird problem where if I change rows in the database, I don't see the newly inserted rows within python.
I use something similar to this..
c = sql.cursor()
c.execute("SELECT * from A")
rows = c.fetchall()
for cur in rows:
print cur[0]
c.close()
FYI, auto-commit is off by default in MySQLdb (and all other python DB libs that follow PEP 249). If you want auto-commit, specify it at connect() time.
Are you maybe forgetting to commit a transaction when inserting rows?
Skip
I don't use transactions..
The rows were inserted from a PHP site. They appear in PHP, and if I use the normal mysql commandline client.
If I had an open transaction, I would assume they wouldn't appear to the mysql client.
Committing the transaction fixed it anyway :/