title: Rails: ActiveRecord::UnknownPrimaryKey exception
body: <pre><code>A ActiveRecord::UnknownPrimaryKey occurred in survey_response#create:
  
  Unknown primary key for table question_responses in model QuestionResponse.
  activerecord (3.2.8) lib/active_record/reflection.rb:366:in `primary_key'
  </code></pre>
  
  <p>Our application has been raising these exceptions and we do not know what is causing them. The exception happens in both production and test environments, but it is not reproducible in either. It <em>seems</em> to have some relation to server load, but even in times of peak loads some of the requests still complete successfully. The app (both production and test environments) is Rails 3.2.8, ruby 1.9.3-p194 using MySQL with the mysql2 gem. Production is Ubuntu and dev/test is OS X. The app is running under Phusion Passenger in production.  </p>
  
  <p>Here is a sample stack trace: <a href="https://gist.github.com/4068400" rel="nofollow">https://gist.github.com/4068400</a><br>
  Here are the two models in question, the controller and the output of "desc question_responses;": <a href="https://gist.github.com/4b3667a6896b60383dc3" rel="nofollow">https://gist.github.com/4b3667a6896b60383dc3</a><br>
  It most definitely has a primary key, which is a standard rails 'id' column.  </p>
  
  <p>Restarting the app server temporarily stops the exceptions from occurring, otherwise they happen over a period of time 30 minutes - 6 hours in length, starting as suddenly as they stop. </p>
  
  <p>It always occurs on the same controller action, table and model.  </p>
  
  <p>Has anyone else run into this exception?</p>