title: Grails, save doesn't save when objects is updated in a service
body: <p>Having a domain that is manipulated from a service and then trying to save that doesn't work even though I use: <code>save(flush:true, failOnError:true)</code> and <code>validate()</code> returns true and <code>hasErrors()</code> returns false.</p>
  
  <p>I do a call from bootstrap:</p>
  
  <pre><code>def timeKeeperService
  def init = { servletContext -&gt;
      def TimeKeeper tk = TimeKeeper.findByName('MAIN')?:new TimeKeeper(name:'MAIN').save(flush:true, failOnError:true)
      tk = timeKeeperService.initialize()
      tk = timeKeeperService.workStart()
  </code></pre>
  
  <p>The Domain:</p>
  
  <pre><code>class TimeKeeper {
  
      String name
      Date dateCreated
      Date dateUpdated
      Date workStart
      Date workEnd
  
      def initialize() {
          println("TimeKeeper initialize...")
          workStart = null
          workEnd = null
      }
  
  
      def workStart() {
         if (workStart == null) {
            println("TimeKeeper - workStart")
            workEnd = null
             workStart = new Date()  
         } else {
  
         }
             println("TimeKeeper - workStart: "+workStart)
      }
  
      def workEnd() {
          if (workEnd == null) {
              workStart = null
              workEnd = new Date()
          } else {
  
          }
  
      }
  
      def beforeInsert() {
          dateCreated = new Date()
          dateUpdated = new Date()
          println("TimeKeeper - beforeInsert workStart: "+workStart)
      }
  
      def beforeUpdate() {
          println("TimeKeeper - beforeUpdate workStart: "+workStart)
          dateUpdated = new Date()
      }
  
      static constraints = {
          dateCreated nullable:true
          workStart nullable:true
          workEnd nullable:true
      }
  }
  </code></pre>
  
  <p>The service:</p>
  
  <pre><code>@Transactional
  class TimeKeeperService {
  
      def TimeKeeper getTimeKeeper() {
          TimeKeeper.findByName('MAIN')
      }
  
      def TimeKeeper initialize() {
          def TimeKeeper TK = getTimeKeeper()
          TK.initialize()
      //    def s = TK.save(flush:true)
      //    println("TimeKeeperService - initialize - save: "+s )
         return TK
      }
  
      def TimeKeeper workStart() {
         def TimeKeeper TK = getTimeKeeper()
         TK.workStart()
         println("TimeKeeperService - validate workStart: "+TK.validate())
      //   TK.save(flush:true, failOnError: true)
           println("TimeKeeperService - workStart: "+TK.workStart+" Errors: "+TK.hasErrors())
         return TK
     }
  </code></pre>
  
  <p>When the object is created from bootstrap it works - object is created and saved.
  But the service methods <code>initialize</code> and <code>workStart</code> does not save even if I make the :</p>
  
  <pre><code>tk.save(flush:true, failOnError:true) 
  </code></pre>
  
  <p>in bootstrap.</p>
  
  <p>But if I set the properties in bootstrap and then call save it works.</p>
  
  <pre><code>    tk.workStart = new Date()
      tk.save(flush:true, failOnError: true)
  </code></pre>
  
  <p>I've struggled for hours with this without success. So I will be very happy if I could get some help solving this.</p>