MySQL Lists are EOL. Please join:

List:General Discussion« Previous MessageNext Message »
From:Rhino Date:November 19 2005 5:09am
Subject:Re: what function could detect a row locked by other client ?
View as plain text  
I know a lot more about DB2, my main database, than MySQL. However, MySQL 
frequently does the same things in the same ways as DB2.

_If_ MySQL behaves the same way as DB2 in this regard - and I do not know if 
it does - there is no function to determine if a given resource is locked. 
Instead, the program which is trying to get a lock but fails because another 
program has the necessary lock simply waits for a set amount of time. If the 
resource (table, row, or whatever) gets unlocked before the clock runs out, 
the waiting programs are permitted to try to get their own locks on the 
resource, basically on a first-come, first-served manner. If the clock runs 
out before the resource has been released by the first program, the waiting 
program(s) get return codes and messages that indicate that they timed out 
and what resource was not available. At that point,  the program can decide 
to try again, as many times as it likes, or to give up. The timeout interval 
can be set/changed by the system administrator.

Again, let me stress that this is how DB2 behaves. MySQL may very well 
behave differently. However, I have noticed a great many similarities 
between DB2 and MySQL so they may behave the same in this regard too. I'm 
looking forward to seeing other answers to your question from people who 
know exactly how MySQL behaves in this regard so that I can learn more about 
MySQL.

Rhino


----- Original Message ----- 
From: "wang shuming" <wangshuming01@stripped>
To: <mysql@stripped>
Sent: Friday, November 18, 2005 11:06 PM
Subject: what function could detect a row locked by other client ?


Hi,
I know select .. update could lock selected rows, if the connection not
release the lock, others always wait.
If I use get_lock() to get a logical lock by key xxxtable+xxxrow , but
others may not update other database on the same server .
What function could detect a row locked (by select ... update) by other
client ?
Best regard!
Shuming Wang



--------------------------------------------------------------------------------


No virus found in this incoming message.
Checked by AVG Free Edition.
Version: 7.1.362 / Virus Database: 267.13.4/175 - Release Date: 18/11/2005



-- 
No virus found in this outgoing message.
Checked by AVG Free Edition.
Version: 7.1.362 / Virus Database: 267.13.4/175 - Release Date: 18/11/2005

Thread
what function could detect a row locked by other client ?wang shuming19 Nov
  • Re: what function could detect a row locked by other client ?Rhino19 Nov
  • Re: what function could detect a row locked by other client ?Gleb Paharenko19 Nov