MySQL Forums
Forum List  »  InnoDB

Re: Deadlock apparently on a single resource: How to avoid?
Posted by: Jan Lindström
Date: January 19, 2006 04:44AM

Ali,

You could use table locking, for example:

BEGIN;
LOCK TABLE T1 WRITE;
SELECT ...FROM T1... FOR UPDATE;
UPDATE T1 ...;
COMMIT;

Note that table locks will decrease concurrency. Remember to lock tables in the same order in all transactions or you will have more deadlocks. Even table locks can't resolve all deadlock situations.

Jan Lindström
Oracle Corp./Innobase Oy
InnoDB - transactions, row level locking, and foreign keys for MySQL

Options: ReplyQuote


Subject
Views
Written By
Posted
Re: Deadlock apparently on a single resource: How to avoid?
1473
January 19, 2006 04:44AM


Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.