Re: MySQL and Autocommit

2008-08-27 Thread Malcolm Tredinnick


On Sat, 2008-08-23 at 11:00 -0700, David Cramer wrote:
> Recently I noticed a bunch of queries I was executing by hand (one's
> which the ORM didn't support) were not being committed.
> 
> I dug into the docs, and it clearly states that the default
> transaction mode is autocommit, and mysql's default transaction mode
> is autocommit.
> 
> So, my question is, what's going on?
> 
> I ended up doing set autocommit=1 at the beginning of the queries, but
> this is a pretty big gotcha.

I just twigged to what you were saying here. There's no gotcha. You were
just forgetting to check the requirements for one piece between you and
the database.

If you're going to do low-level Python database work (at the level of
MySQLdb), the important thing to read is PEP 249. Without that, it's
just a bunch of guesses. This behaviour is documented there. Auto-commit
must initially be off for Python DB-API-2.0-compliant modules. This is
consistent behaviour across all Python database wrappers.

Regards,
Malcolm



--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Django developers" group.
To post to this group, send email to django-developers@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-developers?hl=en
-~--~~~~--~~--~--~---



MySQL and Autocommit

2008-08-23 Thread David Cramer

Recently I noticed a bunch of queries I was executing by hand (one's
which the ORM didn't support) were not being committed.

I dug into the docs, and it clearly states that the default
transaction mode is autocommit, and mysql's default transaction mode
is autocommit.

So, my question is, what's going on?

I ended up doing set autocommit=1 at the beginning of the queries, but
this is a pretty big gotcha.
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Django developers" group.
To post to this group, send email to django-developers@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-developers?hl=en
-~--~~~~--~~--~--~---