I have searched many threads and stackoverflow but I couldn't found any solution. I am trying to insert records into few innodb tables randomly rather one condition matches which cause whole database down. I am getting this error "Lock wait timeout exceeded; try restarting transaction"
One the question (#1103248) has been answered here
In InnoDB, an insert on an auto-increment column results in a table lock. Selecting a row FOR UPDATE results in a row level lock.
All tables are just used for inserts none of them table performs updated at all. My question is how do I avoid these locks? Is there any solution available?