title: grails error on save: cannot cannot execute nextval() in a read-only transaction
body: <p>Having trouble creating an object "from scratch" (in code instead of from forms) in Grails.  The following is the code snippet from a method in a controller (Assessment).</p>
  
  <pre><code>def newVol = new Vol(
                volType:type,
                  app: assessmentInstance.app,
                  assessment:assessmentInstance,
                  dateFound: assessmentInstance.assDate,
                  urlParam: url,
                  volName: "TEST",
                  volNote: "TEST"
           )
  
          newVol.save(validate:false,flush:true, failOnError:true)
  </code></pre>
  
  <p>result is this error:</p>
  
  <pre><code>Class
  org.postgresql.util.PSQLException
  Message
  ERROR: cannot execute nextval() in a read-only transaction
  </code></pre>
  
  <p>the id is mapped to a generator in the Vol class:</p>
  
  <pre><code>   static mapping = {
      id column:'vol_id'
  
      id generator: 'sequence',params:[sequence:'scan_sequence']
  }
  </code></pre>
  
  <p>I really don't understand how a save could be thought of as a read-only transaction.  I tried messing around with the @transactional settings on my domain class, first putting readOnly to false and then removing the @transactional but it did not change things.  It looks like I should look for alternatives to using a database sequence.  What do you think?</p>
  
  <p><strong>UPDATE</strong>
  removed the readonly=true from the controller where the above code lives and that worked.  But... what are the side effects of removing that?</p>