On Sat, Aug 9, 2008 at 8:10 AM, John Smith <[EMAIL PROTECTED]> wrote:
> Now here's the question: I need to lock certain rows, so that no other
> client can read or write that rows (I want those clients to wait until the
> transaction is commited or rolled back). I don't want to lock the entire
> table, since that would block to many clients, which never intended to
> read the critical rows.

Assuming you're using InnoDB tables, "SELECT...FOR UPDATE" will lock
the rows as you describe.  It can prevent other inserts and updates to
neighboring rows as well, depending on what isolation level you're
running (default is REPEATABLE READ).

- Perrin

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

Reply via email to