question about deleting records from mysql

Mage mage at mage.hu
Wed Jul 27 08:04:15 EDT 2005


nephish wrote:

>Simon Brunning wrote:
>
>  
>
>>On 27 Jul 2005 04:29:33 -0700, nephish at xit.net <nephish at xit.net> wrote:
>> 
>>
>>    
>>
>>>Hey there,
>>>sorry , second question in as many days.
>>>i am trying to do some stuff with MySQLdb and the thing is, i can
>>>select records and such, but when i try to delete them, they dont
>>>really go away.
>>>   
>>>
>>>      
>>>
>>A fiver says you need to commit your changes.
>>
>> 
>>
>>    
>>
>ok, do i do that with cursor.commit() ?
>thanks
>  
>
Yes, or maybe you should write a lightweight layer between the dbapi and 
your program which can turn on and off the autocommit by calling 
"commit" and "begin" as query. I did this in my pgsql layer. Using 
transactions every time is almost as bad as never using them.

       Mage




More information about the Python-list mailing list