Opened 15 years ago
Closed 15 years ago
#11248 closed (invalid)
Multiple connections; different query results. with mysql innodb engine
Reported by: | Owned by: | nobody | |
---|---|---|---|
Component: | *.djangoproject.com | Version: | 1.0 |
Severity: | Keywords: | innodb mysql cached | |
Cc: | Triage Stage: | Unreviewed | |
Has patch: | no | Needs documentation: | no |
Needs tests: | no | Patch needs improvement: | no |
Easy pickings: | no | UI/UX: | no |
Description
This is always reproducable with innodb, but works as expected w/ postgres or myiasm
With a simple model and caching disabled.
create a instance in the admin interface and save
in a manage.py shell load the instance ( .get() or .all()[0])
change the instance in the admin and save
reload the instance in the shell (.get() or .all()[0])
the shell instance is the old version that seems to be cached !!
Same problem between 2 shells or if you change in a shell and refresh the admin page.
The save is happening and all looks well if you inspect tables with mysqls client after save, so problem seems to be on retrieval side.
Thanks in advance,
--Lloyd
django v 1.0.2
MySQLdb v 1.2.2
mysql Ver 14.14 Distrib 5.1.31, for sun-solaris2.10 (sparc)
Python 2.5.4 (r254:67916, Jan 16 2009, 17:22:03)
IPython 0.9.1 -- An enhanced Interactive Python.
Change History (3)
comment:1 by , 15 years ago
milestone: | 1.2 |
---|
comment:2 by , 15 years ago
comment:3 by , 15 years ago
Resolution: | → invalid |
---|---|
Status: | new → closed |
You're almost certainly seeing the effects of the default transaction-isolation level used by MySQL's InnoDB engine (REPEATABLE READ
). Please consult MySQL's documentation for details on what this means and how to change the behavior.
Same post as original, but readable...Sorry
This is always reproducable with innodb, but works as expected w/ postgres or myiasm.
With a simple model and caching disabled.
Create an instance in the admin interface and save.
In a manage.py shell load the instance
( .get() or .all()[0])
.Change the instance in the admin and save.
Reload the instance in the shell
(.get() or .all()[0])
The shell instance is the old version of the object, that is you don't see the change made in the line above, it seems to be cached !!
Same problem between 2 shells or if you change in a shell and refresh the admin page. The save is happening and all looks well if you inspect tables with mysqls client after save, so problem seems to be on retrieval side.
Thanks in advance,
django v 1.0.2
MySQLdb v 1.2.2
mysql Ver 14.14 Distrib 5.1.31, for sun-solaris2.10 (sparc)
Python 2.5.4 (r254:67916, Jan 16 2009, 17:22:03)[[BR]]
IPython 0.9.1 -- An enhanced Interactive Python.