text: I think that Grails may currently support static and non-static, but I believe the officially documented approach specifies static only.
  Stephen, you’re right. I should have explicitly declared the ‘transactional’ property to be ’static’.
  If the offer.save() in line 9 is unsuccessful although the validate succeeded, will grails throw a RunTimeException by itself ?
  Or more general: Is the explicit validate done just for better messages or is it really necessary because the save does not throw an Exception?
  The save() method does call the validate() method by itself,but unless you use flush true, it will not do the persistence instantly. And hence we are explicitly doing validate, and then letting it do the save whenever it wants, and knowing that the save will be successful.
  Sorry, the code isn’t meant to just take it and run it as it is. I was only talking about concepts and might have avoided some util method due to lack of space.
  I would like to know who is the fucking idiot that implements grails persistence actions… No way to understand why a domain class is not valid when you call the method save(), no exception thrown !
  When I see how easy and fast it is to build J2E applications with maven, jsf, spring, hibernate and so on… I really dont see why grails should be a revolution.
  The first wish of a developer is to have pertinent and understanding exceptions thrown when he makes some mistakes…
  I know it can be confusing in the beginning, but it as easy as calling the the validate() method, if you need to validate that your domain will persist:
  I have submitted a to the Grails JIRA that will iculnde the chainArgs in the ControllerUnitTest case, so maybe soon it will be available in the same way as renderArgs and redirectArgs. I’m glad you posted this, because I never knew it existed before. I was doing workarounds doing metaClass manipulation (yuck!).
  I wonder how GC gets impacted by massive creating of objects in Eden segment. Has anyone run into long GC process that blocks application for some seconds?
  If so, can you please share GC configuration? Parallel? Old parallel? New concurrent mark sweep? Size for Eden and Mature segments?
  We use a similar batch style save, but have run into a slight snag. Clearing the current session may cause side-effects if you do work in your controller AFTER calling the batch save and that work relies on lazy loading.
  Any one know a way of doing the batch save that either doesn’t need to clear or can utilize a session that operates only within the confines of the Service.batchSave() method leaving the request’s session intact?
  I am using grails 1.3.7 and facing an issue with the transactions. Service layer is not getting rolled back if any exception is thrown. I should be by default set to true and no need to give static def transactional =true at service layer but still if i give transactional = true it dosent work
  In response to my previous post, performing a session.evict(obj) within the Service.batchSave() method after each individual save resolved my issues.
  I tried everything I could to process a large process in one transaction but it always ran out of memory, i tried
  but still no use. Only way I could do it was by setting static transactional = false and breaking the process into smaller transactions using Domain.withTransaction{} but this is not so good as if anything goes wrong then some of my database table is now only partially processed which is not good
  I have the same problem. I am running a grails script that use a service to import few hundred thousand rows into a mongodb. I use grails to do the validation of my domain but right now I am running into a wall. It seems that grails is doing some caching for each find reqiest and finally running of GC Heap.
  I tried to clear the session but my sessionFactory is null. (not injected). Everything else is. So that is a mystery.