Hello.


Transactions are usually used for such purposes, just as

'select ... for update'.



You may have interest in: 



http://dev.mysql.com/doc/mysql/en/InnoDB_locking_reads.html

http://dev.mysql.com/doc/mysql/en/Transactional_Commands.html



Julien ALLANOS <[EMAIL PROTECTED]> wrote:





> Hello,

> 

> Basically, I have multiple MySQL clients that have to delete entries from=

> a

> InnoDB table in a concurrent environment. What they do is:

> 1 - getting the first entry of the table that needs to by deleted, by exe=

> cuting

> a "SELECT ... LIMIT 1" query,

> 2 - doing stuff with the query result,

> 3 - deleting the entry from the table if everything went right.

> 

> However, let's say user A has executed the SELECT query and starts "doing

> stuff". Before A has deleted the entry from the table, user B executes th=

> e

> SELECT query: he gets the same result as A, and starts doing the *same* s=

> tuff

> as A, which is something I need to avoid.

> 

> How could I achieve this? Is it possible to have blocking SELECT queries,=

> or to

> set read locks on one row (without locking all the table, to let others u=

> sers

> purge the following entries)?

> 

> Thanks for feedback.

> --=20

> Julien ALLANOS

> Silicomp-AQL

> ************************************************************

> The contents of this email and any attachments are

> confidential. They are intended for the named recipient(s)

> only.

> If you have received this email in error please notify the

> system manager or the sender immediately and do not disclose

> the contents to anyone or make copies.

> 

> * email scanned for viruses, vandals and malicious content *

> ************************************************************

> 



-- 
For technical support contracts, goto https://order.mysql.com/?ref=ensita
This email is sponsored by Ensita.NET http://www.ensita.net/
   __  ___     ___ ____  __
  /  |/  /_ __/ __/ __ \/ /    Gleb Paharenko
 / /|_/ / // /\ \/ /_/ / /__   [EMAIL PROTECTED]
/_/  /_/\_, /___/\___\_\___/   MySQL AB / Ensita.NET
       <___/   www.mysql.com




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

Reply via email to