I'm using a MySQL 5.0
My application is used by multiple user. All data is served with one shared table products
(for update )and i don't want to loose any user update,i can't lock entire table bcz it slow down my application.for same reason i can not apply lock in my program.
Now I want to use:
SELECT * FROM products limit 1;
...so that other database connections unable to read this row until update is finished.
I tried:
query = "select min(nextag_product_id) from products where is_bottomline = 0 and timestamp <= date_sub(now(), interval 30 minute) for update"
...but this is not able to lock other connection to to read this row.At a time same products is opening on more than one user.
Which is the correct hint to do a SELECT FOR UPDATE as known for MySql?