title: Django "Lock wait timeout exceeded; try restarting transaction" while saving/updating a model
body: <p>I'm still a little new to Django, and I'm getting (1205, 'Lock wait timeout exceeded; try restarting transaction') when I try to update my model via the admin interface. Earlier today, it was working, and I've been rolling back changes to the last working version to try to narrow down what seems to be the issue.</p>
  
  <p>The problem seems to be it failing to update and timing out. Just editing and hitting save in via the admin interface is triggering this issue. I've disabled any signal handling (post/presave) I had setup, but I think just the UPDATE call after hitting save changes is triggering this issue.</p>
  
  <p>I've looked into it and can kill the process after following this link:
  <a href="https://stackoverflow.com/questions/5836623/getting-lock-wait-timeout-exceeded-try-restarting-transaction-even-though-im">Getting &quot;Lock wait timeout exceeded; try restarting transaction&quot; even though I&#39;m not using a transaction</a></p>
  
  <p>But it doesn't solve the problem. I can kill the process while it's going, but it's the only running query, and not even a big one at that.</p>
  
  <p>The model only has 7 fields, describing VPN servers I'm cataloguing. A show processlist gives me this:</p>
  
  <blockquote>
    <p>updating | UPDATE <code>openvpn_client</code> SET <code>name</code> = 'rsa_test1',
    <code>local_ip</code> = '2.2.2.2', <code>vpn_ip</code> = NULL, <code>type</code> =</p>
  </blockquote>
  
  <p>The end gets cut off in the table, but I'm assuming it has the rest there.</p>
  
  <p>I've considered it being a size problem, but I only have 4 entries so far in my table for 'Clients', and none of them store any sort of large data.</p>
  
  <p>So far, I'm thinking it's a mySQL problem, and not a Django one, and have half a mind to start over with a new database.</p>
  
  <p>I'm not looking to increase the timeout value since it used to run in less than a second to update these fields, so not quite sure what's changed since then.</p>