title: Grails behavior method AddTo*
body: <p>I'm an instability in my addTo* method which I have a record that constantly have to make the relationship information in one instance . The problem is that when I place multiple inserts in a short time , they cease to be persisted in the database and not after a they return , they are simply discarded time.</p>
  
  <p>My simple class is ' Occurrence ' and ' Monitoring ' , whenever I make a call I have to register it and it occurred on and after 2 consecutive records the 3rd no longer persists in the database and I lose the record .</p>
  
  <pre><code>Class Occurrence implements Serializable{
  ...
  hasMany = [accompaniments: Monitoring]
  ...
  }
  
  Class Monitoring implements Serializable{
  ...
  belongsTo = [occurrence : Occurrence]
  ...
  }
  </code></pre>
  
  <p>Have the controller looks like this:</p>
  
  <pre><code>def regMonitoring(Long id){
  
          def chamadoInstance = Occurrence.get(id)
  
          if (!chamadoInstance) {
              flash.message = message(code: 'default.not.found.message', args: [message(code: 'Occurrence .label', default: 'Occurrence '), id])
              return
          }
  
          chamadoInstance.status = StatusChamado.findByCodigo("MOV") 
  
          if (!chamadoInstance.save(flush: true)) {
              render(view: "editMonitoring", model: [chamadoInstance: chamadoInstance])
              return
          }
  
  
          def mov = chamadoService.regMonitoring("") //returns an instance of Customer with preset output values ​​.
  
          chamadoInstance.addToAccompaniments (mov) 
  
          redirect(action: "showChamado", id: chamadoInstance.id)
  
  
      }
  </code></pre>