Help: Detecting locks?

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Fast Eddie

    Help: Detecting locks?

    Hi,

    I'm writing a program (using mysql++) where I want users to be able to
    lock a row while they are editing it. My problem is I don't know how
    the 2nd user can detect the lock vs it looking like a failed query.

    I have innodb_lock_wai t_timeout set to 1 second, which works fine, but
    mysql returns two errors when I try to update:

    ERROR 1205 (HY000): Lock wait timeout exceeded....
    ERROR 1064 (42000): You have an error in your SQL syntax....

    Unfortunately, as far as I know, I can only get the *last* error from
    the query which is 1064 - bad syntax. Since the 1064 overwrites the
    1205 error, I can't differentiate the two.

    Any ideas?

    Thanks,
    Mike

Working...