On 6/4/07, Jerry Schwartz <[EMAIL PROTECTED]> wrote:

Whatever you do, make sure that every bit of code that locks multiple
resources locks them in the same order. That's the only way to avoid
deadlocks.


Hi Jerry,

I really appreciate the good advice.

However, my original question is still unanswered.  My original question is
whether I can lock one table (as a gentleman's rule followed by all
processes) to serialize access to the database consisting of many tables.

LOCK TABLE x;
Manipulate many tables, perhaps not even including table x;
UNLOCK TABLES;

My question is really whether MySQL might do some strange optimizations ...
or somehow buffer the middle query so that it completes after the UNLOCK.

Thanks, Dave.

Reply via email to