Grails GORM auto update issue
===

I have a test Grails application. I have one domain class test.Test:

    package test
    
    class Test {
       String name
       static constraints = {}
    }

Also I have a service test.TestService:

    package test
    
    class TestService {
    
        static scope = "singleton"
        static transactional = true
    
        def dostuff() {
            println "test service was called"
        }
    }


And one controller test.TestController:


    package test

    class TestController {

      def testService      

      def index = {
         def obj = new Test(name:"lol")
         obj.save(flush:true)
         obj.name = "lol2"
         testService.dostuff()
         println "done"
      }
    }


So what I do:

 - Create a domain object
 - Change one of it's properties
 - Call a singleton service method

What I would expect:

 - Nothing gets persisted to the db unless I call obj.save()

What happens instead:

 - Right after the service call Grails will do an update query to the database.

I have tried the following configuration from this url: http://grails.1312388.n4.nabble.com/Turn-off-autosave-in-gorm-td1378113.html

    hibernate.flush.mode="manual"

But it didn't help.

I have tested it with Grails 1.3.7, Grails 2.0.3 does not have this issue.

Could anyone please give me a bit more information on what is exactly going on? It seems like the current session has to be terminated because of the service call and because the object is dirty it is getting automatically persisted to the database after the service call. What I don't understand that even with the manual flush mode configuration in Hibernate does not help.

Thanks in advance!
