Code

Opened 5 years ago

Closed 5 years ago

#11248 closed (invalid)

Multiple connections; different query results. with mysql innodb engine

Reported by: Lloyd <lloyd@…> 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: UI/UX:

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.

Attachments (0)

Change History (3)

comment:1 Changed 5 years ago by Lloyd <lloyd@…>

  • milestone 1.2 deleted
  • Needs documentation unset
  • Needs tests unset
  • Patch needs improvement unset

comment:2 in reply to: ↑ description Changed 5 years ago by Lloyd <lloyd@…>

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,

--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)[[BR]]
IPython 0.9.1 -- An enhanced Interactive Python.

comment:3 Changed 5 years ago by ubernostrum

  • Resolution set to invalid
  • Status changed from new to 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.

Add Comment

Modify Ticket

Change Properties
<Author field>
Action
as closed
as The resolution will be set. Next status will be 'closed'
The resolution will be deleted. Next status will be 'new'
Author


E-mail address and user name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.