hi,
I'm new to this list, but not so new to using MySQL and have a question
about locking. (This is my first foray into datalocking with MySQL.)

I'd like to lock a table (a row in that table would be better) for read
and write access to prevent mishaps from occurring during data
manipulation.

At the moment, what I am doing is:

        execute "LOCK TABLES foo READ"
        select info from foo
        //next lock implictly unlocks previous one
        //as it's done by the same thread/process
        //chances of conflicts occurring are probably
        //only theoritical.
        execute "LOCK TABLES foo WRITE"
        manipulate info
        update_sql = ...
        execute update_sql
        execute "UNLOCK TABLES"

and it seems to work fairly ok, but I'd like to get an opinion on
this from somebody experienced.

any help/opinions on this would be much appreciated.

thanks

Ken


---------------------------------------------------------------------
Before posting, please check:
   http://www.mysql.com/manual.php   (the manual)
   http://lists.mysql.com/           (the list archive)

To request this thread, e-mail <[EMAIL PROTECTED]>
To unsubscribe, e-mail <[EMAIL PROTECTED]>
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php

Reply via email to