Hey,
We're using MySQL with Innodb Engine storage. We have an "evented" environment that sends multiple concurrent requests on a table. Basically, it works like this: We have a find_or_insert function that does that: - find() -> on result, if empty -> insert -> on result find()
We're using a non-blocking MySQL driver, so basically, when we start this small algorithm more than once at the same time, it runs all the finds before inserting the first result... etc.
Unfortunately, we get these errors : "Deadlock found when trying to get lock; try restarting transaction"
Anyone can help with that?
[EDIT] : Also, I actually do not understand why would MySQL need to lock the table just to insert a new element here. Initially I though the auto-increment was the culprit here, so I removed it... bu I still get the error. Is there a way to prevent MySQL to lock the table on inserts?