List:MySQL++« Previous MessageNext Message »
From:Warren Young Date:May 30 2008 11:48am
Subject:Re: Deadlock exception
View as plain text  
António Santos wrote:
> This happened when I was using transactions but then I removed the use 
> of transactions and I get the same result.
> Do anyone know why this is happening? I have a mutex that assures that 
> two threads do not affect the same rows at the same time.

First, I want to point out that this error comes from the MySQL server. 
  MySQL++ is only reporting it.

A Google search for ER_LOCK_DEADLOCK (the underlying MySQL error code) 
says there are many more causes for this error than trying to modify 
rows at the same time.

Rather than try to fight all of these cases, why not follow the advice 
in the MySQL++ user manual, and use a separate Connection from each 
thread?  You cannot cause a MySQL server deadlock in this situation.
Deadlock exceptionAntónio Santos30 May
  • Re: Deadlock exceptionWarren Young30 May
    • Re: Deadlock exceptionWarren Young30 May