title: Error: Row was updated or deleted by another transaction (or unsaved-value mapping was incorrect)
body: <p>I have the following action: </p>
  
  <pre><code>def index() {
  
    User.withNewTransaction {
  
     def user = User.get(params.userId)
     user.name = "test"
     user.save(flush:true)
  
     response.setContentType("image/gif")
     response.outputStream &lt;&lt; PIXEL_BYTES_OF_A_GIF_IMAGE
     return
    }
  }
  </code></pre>
  
  <p>When running, I sometimes get the following error:</p>
  
  <pre><code>Message
  Executing action [index] of controller [test.TestController] caused exception: Runtime error executing action
  Caused by
  Row was updated or deleted by another transaction (or unsaved-value mapping was incorrect): [test.User#1]
  </code></pre>
  
  <p>Why does this error happen? I thought <code>withNewTransaction</code> would prevent this error.</p>