title: Grails - Hibernate/Validation of Domain object list
body: <p>With Grails, you have the save meta method attached to the Domain object. I have a list of objects that I want to save all together. But, if one of these fails, I want the whole 'transaction' to fail:</p>
  
  <pre><code>while(allDomainObjects) {
     try { 
        thisObject.save()
     }
     catch(...) {
       // end transaction
       // kill all pending that weren't flushed yet?
     }
  }
  
  flushAll()?
  </code></pre>
  
  <p>If it does not fail, I want to basically persist all objects that were saved in a 'flush all' method. On that same level, I want to kill all these pending saves if I have half way through the allDomainObjects iteration so that none of the calls persist.</p>
  
  <p>I am using the default Hibernate/SiteMesh layers for my project. How do I handle these multiple domain save transactions??</p>
  
  <p>Thanks!</p>