Must COMMIT after SELECT (was: Very weird behavior in MySQLdb "execute")

Frank Aune Frank.Aune at broadpark.no
Thu Feb 7 02:52:39 EST 2008


On Wednesday 06 February 2008 16:16:45 Paul Boddie wrote:
> Really, the rule is this: always (where the circumstances described
> above apply) make sure that you terminate a transaction before
> attempting to read committed, updated data.

How exactly do you terminate a transaction then?Do you terminate a transaction 
by closing the cursor? Would this indicate that for each query you perform 
against the db, you should:

- Open cursor
- Perform query
- Close cursor

The concept of cursor in MySQL is apparantly very different from what I 
originally thought. I always thought the cursor is the "handler" for a 
certain connection, and that you needed to commit before closing down this 
handler - else changes were automatically rolled back.

Thanks,
Frank



More information about the Python-list mailing list