title: Is get_or_create() thread safe
body: <p>I have a Django model that can only be accessed using <code>get_or_create(session=session)</code>, where session is a foreign key to another Django model.</p>
  
  <p>Since I am only accessing through <code>get_or_create()</code>, I would imagine that I would only ever have one instance with a key to the session. However, I have found multiple instances with keys to the same session. What is happening? Is this a race condition, or does <code>get_or_create()</code> operate atomically?</p>