Mod python - mysql lock

Roopesh roopesh.raj at gmail.com
Mon Mar 5 04:23:58 EST 2007


Hi,
In my mod_python project I am using mysql as the database. There is
table card in which unique cards are stored. When a user request comes
he has to get a unique card. In this situation I want to use LOCK with
which I can prevent other users accessing the table. I tried excuting
"LOCK" command of mysql through python code, but it is not locking the
database. Any ideas why this isn't working and how can I do the same.

//python code
sql = "LOCK TABLES card WRITE"
cursor.execute(sql)


Regards
Roopesh




More information about the Python-list mailing list