title: Error processing GroovyPageView: could not advance using next using grails annotation transaction
body: <p>I have "Error processing GroovyPageView: could not advance using next()" error in my view if I add annotation Transactional to controller class</p>
  
  <p><strong>Controller</strong></p>
  
  <pre><code>@Transactional(readOnly = true)
  class SomeController {
      ...
      def sessionFactory
  
      def list(){
          def list = sessionFactory.currentSession.createSQLQuery( "some_query" ).scroll()
  
          [ list : list ]
      }
  }
  </code></pre>
  
  <p><strong>View</strong></p>
  
  <pre><code>...
  &lt;g:while test="${ list?.next() }"&gt; &lt;%-- exception here --%&gt;
      &lt;g:set var="instance" value="${ list.get() }"/&gt;
  ...
  </code></pre>
  
  <p>If I remove <strong>@Transactional(readOnly = true)</strong> works all ok, does anybody knows how to configure transactional annotation using scrolls in views?</p>
  
  <p><strong>NOTE:</strong> I use grails 2.4.4 </p>
  
  <p><strong>UPDATE</strong>
  I tried with these three and nothing, same error;</p>
  
  <pre><code>@Transactional
  class SomeController {
  ...
  @Transactional(readOnly = true)
  class SomeController {
  
      @Transactional(readOnly = false)
      def list(){
  ...
  @Transactional(readOnly = false)
  class SomeController {
  
      @Transactional(readOnly = false)
      def list(){
  </code></pre>
  
  <p>Here whole error:</p>
  
  <pre><code>2015-04-15 15:22:50,402 [http-bio-8080-exec-8] ERROR errors.GrailsExceptionResolver  - PSQLException occurred when processing request: [GET] /app
  This ResultSet is closed.. Stacktrace follows:
  Message: Error processing GroovyPageView: could not advance using next()
      Line | Method
  -&gt;&gt;  257 | doFilter  in \grails-app\views\some\list.gsp
  
  Caused by GenericJDBCException: could not advance using next()
  -&gt;&gt;  265 | doCall    in list_gsp$_run_closure2
  |    291 | run       in list_gsp
  |    198 | doFilter  in grails.plugin.cache.web.filter.PageFragmentCachingFilter
  |     63 | doFilter  in grails.plugin.cache.web.filter.AbstractFilter
  |     53 | doFilter  in grails.plugin.springsecurity.web.filter.GrailsAnonymousAuthenticationFilter
  |     49 | doFilter  in grails.plugin.springsecurity.web.authentication.RequestHolderAuthenticationFilter
  |     82 | doFilter  in grails.plugin.springsecurity.web.authentication.logout.MutableLogoutFilter
  |     76 | doFilter  in org.jasig.cas.client.session.SingleSignOutFilter
  |   1145 | runWorker in java.util.concurrent.ThreadPoolExecutor
  |    615 | run       in java.util.concurrent.ThreadPoolExecutor$Worker
  ^    745 | run . . . in java.lang.Thread
  
  Caused by PSQLException: This ResultSet is closed.
  -&gt;&gt; 2852 | checkClosed in org.postgresql.jdbc2.AbstractJdbc2ResultSet
  |   1890 | next      in     ''
  |    265 | doCall .  in list_gsp$_run_closure2
  |    291 | run       in list_gsp
  |    198 | doFilter  in grails.plugin.cache.web.filter.PageFragmentCachingFilter
  |     63 | doFilter  in grails.plugin.cache.web.filter.AbstractFilter
  |     53 | doFilter  in grails.plugin.springsecurity.web.filter.GrailsAnonymousAuthenticationFilter
  |     49 | doFilter  in grails.plugin.springsecurity.web.authentication.RequestHolderAuthenticationFilter
  |     82 | doFilter  in grails.plugin.springsecurity.web.authentication.logout.MutableLogoutFilter
  |     76 | doFilter  in org.jasig.cas.client.session.SingleSignOutFilter
  |   1145 | runWorker in java.util.concurrent.ThreadPoolExecutor
  |    615 | run       in java.util.concurrent.ThreadPoolExecutor$Worker
  ^    745 | run . . . in java.lang.Thread
  </code></pre>