This is a discussion on is it possible to test row lock in mysql ? within the MySQL forums, part of the Database Server Software category; --> Hello sometime i need to lock for a while a record. For example, a table of invoice, and a ...
| |||||||
| Register | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
| ||||
| Hello sometime i need to lock for a while a record. For example, a table of invoice, and a table of line of invoice. When a user want to modify lines of an invoice, i lock the invoice against write/delete while the user take time to modify lines. and if another user want to modify the same invoice, he get a nice message like "this invoice is beeing modified by another user" I can use "begin; select * from invoice where idinvoice=x for update" before letting the user modifying lines. but if another user come for the same invoice, he got a big timeout. is there a way to just test if a row a locked to avoid the timeout ? |