﻿id	summary	reporter	owner	description	type	status	component	version	severity	resolution	keywords	cc	stage	has_patch	needs_docs	needs_tests	needs_better_patch	easy	ui_ux
17771	weird problem db with autocommit	meister	nobody	"Hello,

Here is problematic code (standard django setup, mysql backend):

{{{
import time

import os, sys, re
sys.path.append(os.path.abspath(os.path.dirname(__file__))+'/..')
os.environ['DJANGO_SETTINGS_MODULE'] = 'settings'

from django.conf import settings

from django.contrib.auth.models import User

#from django.db import connection
#cursor = connection.cursor()
#cursor.execute('SET autocommit = 1')

while True:
    u = User.objects.get(pk=1)
    print u.first_name
    time.sleep(1)
}}}

It displays user first_name each second. On the other hand with mysql client :
{{{
$ update auth_user set first_name = ""foo"" where id=1;
}}}
Value does not update in my loop (wireshark shows the old value too in the mysql packets dumped). If I restart the process, it fetch the correct new value. 
I can fix the problem by adding the 3 autocommit lines commented out.

Problem do not occur on my ubuntu 32b desktop (32bits django 1.3.1 / MySQL-python 1.2.3, mysql 5.1.58) nor a debian squeeze server (32bits mysql 5.1.49).

Problem occurs on a 64 bits debian squeeze server (64bits mysql 5.1.49) and a ubuntu 64 server (64 bits mysql 5.1.41).

Thanks.
"	Bug	closed	Database layer (models, ORM)	1.3	Normal	wontfix			Unreviewed	0	0	0	0	0	0
