title: why mysql insert could cause lock wait timeout exception
body: <p>when execute unit test(<code>mvn test</code>) sometimes there is below exception</p>
  <pre><code>org.springframework.dao.CannotAcquireLockException:
  
  ### Error updating database.  Cause: java.sql.SQLException: Lock wait timeout exceeded; try restarting transaction
  ### The error may involve com.foo.dao.mapper.TestMapper.insertSuccesfulPaymentOrder-Inline
  ### The error occurred while setting parameters
  ### SQL: insert into order(order_seq,note,user_id,product_id, pay_status) values(uuid(),'',?,?,1)
  ### Cause: java.sql.SQLException: Lock wait timeout exceeded; try restarting transaction
  ; SQL []; Lock wait timeout exceeded; try restarting transaction; nested exception is java.sql.SQLException: Lock wait timeout exceeded; try restarting transaction
  </code></pre>
  <p>and from <a href="http://dev.mysql.com/doc/refman/5.7/en/innodb-parameters.html#sysvar_innodb_lock_wait_timeout" rel="nofollow noreferrer">mysql document</a> I know</p>
  <blockquote>
  <p>The length of time in seconds an InnoDB transaction waits for a row lock before giving up. The default value is 50 seconds. A transaction that tries to access a row that is locked by another InnoDB transaction waits at most this many seconds for write access to the row before issuing the following error:</p>
  <blockquote>
  <p>ERROR 1205 (HY000): Lock wait timeout exceeded; try restarting transaction</p>
  </blockquote>
  </blockquote>
  <p>So I think only when update some row could have this exception, but my is <code>insert</code> operation, why still have this exception? And how could I reproduce it directly in mysql session?</p>