title: Using Grails Exector Plugin's runAsync , Why do I need a transaction to save a Domain object?
body: <p>Here's roughly what I'm doing in a service:</p>
  
  <pre><code>runAsync 
  {
    &lt;some work here&gt;
    myDomainObject.merge()     
  }
  </code></pre>
  
  <p>I get an error saying "No Hibernate Session bound to thread, and configuration does not allow creation of non-transactional one here". I know for sure that the code is being run asynchronously, so it would seem that the Executor Plugin is setup correctly.</p>
  
  <p>So I tried this next, thinking the domain object "myDomainObject" must not be bound in this thread although the thread has a hibernate session thanks to the executor plugin:</p>
  
  <pre><code>runAsync
  {
    &lt;work&gt;
    def instance2= MyDomainObject.get(myDomainObject.id) // works
    instance2.field1=123
    instance2.save() // fails
  }
  </code></pre>
  
  <p>I get the same error here and interestingly, the get() succeeds in bringing the correct data and setting it to instance2. It's only the "save()" that fails. I know this because I've stepped through the code in a debugger. </p>
  
  <p>Finally, if I do the following, everything works:</p>
  
  <pre><code>runAsync 
      {
        &lt;some work here&gt;
        MyDomainObject.withTransaction {
             myDomainObject.field1=123
             myDomainObject.merge()
        }
      }
  </code></pre>
  
  <p>I don't understand why this transaction is required since I haven't set the service I'm writing the above code in to be transactional. I know there must be something fundamental that I don't know here, but I can't find out what it is.</p>