title: Groovy SQL Error - This ResultSet is closed
body: <p>I am using Groovy's Sql object to perform queries on a postgres db. The queries are being executed as follows:</p>
  
  <pre><code>List&lt;Map&gt; results = sql.rows("select * from my_table")
  List&lt;Map&gt; result2= sql.rows("select * from my_second_table")
  </code></pre>
  
  <p>I have a groovy method that performs two queries and then does some processing to loop through the data to make a different dataset, however, on some occasions I recieve a postgres exception <code>"This ResultSet is closed"</code> error.</p>
  
  <p>having searched, I originally thought it might be to do with the issue here: <a href="https://stackoverflow.com/questions/10118129/sqlexception-this-resultset-is-closed">SQLException: This ResultSet is closed</a> (running multiple queries and trying to access the data from the resultsets after the fact) - however, we only seem to get the exception on quite high load - which suggests that it isnt as simple as the first dataset is closed on executing the second query as if this was the case I would expect it to happen consistently.</p>
  
  <p>Can anyone shed any light on how Groovy's Sql object handles these situations or suggest what might be going wrong?</p>