title: Write operations are not allowed in read-only mode (FlushMode.MANUAL): with grails hibernate
body: <p>I have integrated spring security plugin with my grails application, which has hibernate as an ORM tool...</p>
  
  <p>using spring security plugin everything is working fine with my application including authentication, authorization...</p>
  
  <p>But recently i got one case where I am facing some issues :</p>
  
  <p>Logged in as : admin
  Role to admin : ROLE_ADMIN
  ROLE_ADMIN privileges : each and every url is accessible to ROLE_ADMIN</p>
  
  <p>so as an admin user when i am trying to update the privileges assigned to ROLE_ADMIN, its throwing the exception :</p>
  
  <pre><code>2011-03-24 10:20:14,035 [http-8080-2] ERROR errors.GrailsExceptionResolver  - Write operations are not allowed in read-only mode (FlushMode.MANUAL): Turn your Session into FlushMode.COMMIT/AUTO or remove 'readOnly' marker from transaction definition.
  org.springframework.dao.InvalidDataAccessApiUsageException: Write operations are not allowed in read-only mode (FlushMode.MANUAL): Turn your Session into FlushMode.COMMIT/AUTO or remove 'readOnly' marker from transaction definition.
          at ConfigController$_closure45_closure59.doCall(ConfigController:1128)
          at ConfigController$_closure45.doCall(ConfigController:1123)
          at ConfigController$_closure45.doCall(ConfigController)
          at java.lang.Thread.run(Thread.java:619)
  </code></pre>
  
  <p>May be that's because I am trying the update the privileges of the logged in user itself...</p>
  
  <p>Inside the code also wherever I am saving/updating/deleting any object using hibernate, I m proving flush:false, for e.g. : </p>
  
  <pre><code>user.save flush:false
  </code></pre>
  
  <p>So I wanna know that is there any way where logged in user can be able to update the privileges that also going to reflect him/herself too..</p>
  
  <p>Thanks in advance..</p>