I have a table (MySQL) with a row in it.
I can read it fine with:
self._session.query(Automatic).\
filter(Automatic.do_when <= time()).\
limit(limit).\
all()
However, if I then delete the row from table (with the mysql client or phpMyAdmin), the row is still returned by the code above. I don't know if this is related to the question "How to disable SQLAlchemy caching?".
Edit: Adding a
self._session.commit()
after makes no difference.
Edit: Adding commit() before reading did the trick, as per eggyal's explanation.
self._session.commit()
self._session.query(Automatic).\
filter(Automatic.do_when <= time()).\
limit(limit).\
all()
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With