title: Grails:: I hate and simply can't unerstand: 'No hibernate session bound to current thread'
body: <p>A simple scenario but making me bang my head against wall, as I'm unable to understand this 'No Hibernate Session bound to current thread'.</p>
  
  <p>Use case to implement:</p>
  
  <pre><code>def records = SomeDomain.list()
  
  //split records into equal size chunks.
  
  def chunks = [][] // &lt;- add records to chunks
  
  //now process each chunk in a different thread
  
  chunks.each { aChunk -&gt;
     Thread.start {
       singletonInjectedService # processs(aChunk)
     }
  }
  </code></pre>
  
  <p>How to achieve this in grails? No matter what is the container, a Quartz Job which wants to process the 'records' in multiple threads or a Service which wants to process 'records' in multiple threads, it simply fails with 'No hibernate session bound to current thread'.</p>
  
  <p>A legitimate use case but pity that its just not working for me at all.</p>