Hi,

I'm doing a PHP application, and there are just a few instances where I need
to do atomic operations on more than one table at a time and I can't express
what I want to do as a single SQL statement.

What I'm trying to guard against, naturally, is race conditions when more
than one process is making modifications at a time, i.e. multiple
simultaneous page hits.

Because my application is so non-demanding in terms of server resources,
what I decided to do is use only one simple locking schema throughout the
code that locks every table at the same time, i.e.

----------

LOCK TABLE widgets WRITE, thingamabobs WRITE ...

Make multiple interrelated table changes.

UNLOCK TABLES

----------

In my estimation, what this should do is cause every other process to sleep
briefly until the first one is through to the UNLOCK TABLES.

I can't see going to a more complex locking model with such a simple
application.

Will the "lock every table" approach work as I intend?  Anything I should
watch out for?

Thanks, Dave.



-- 
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:    http://lists.mysql.com/[EMAIL PROTECTED]

Reply via email to