Take the 2-minute tour ×
Database Administrators Stack Exchange is a question and answer site for database professionals who wish to improve their database skills and learn from others in the community. It's 100% free, no registration required.

Select for update nowait doesn't work in MySQL 5x (innodb). Is there any function like NOWAIT in MySQL?

share|improve this question
add comment

2 Answers

When it comes to InnoDB, SELECT FOR UPDATE has the potential for leaving lingering locks. This not a new subject as shown in the Forums:

I wrote about this before in the DBA StackExchange

Note what the MySQL Documentation said on this:

When InnoDB performs a complete rollback of a transaction, all locks set by the transaction are released. However, if just a single SQL statement is rolled back as a result of an error, some of the locks set by the statement may be preserved. This happens because InnoDB stores row locks in a format such that it cannot know afterward which lock was set by which statement.

You best chance it to change innodb_lock_wait_timeout to your liking

share|improve this answer
add comment

MySQL provides the ability to set application-specific locking using the GET_LOCK() function. You can check if the mutex has been taken by using the IS_FREE_LOCK() function.

You can refer this thread for detail: http://forums.mysql.com/read.php?22,45679,45679#msg-45679

Also, Non-blocking queries are not supported by MySQL:

http://lists.mysql.com/mysql/219041

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.