Grails Criteria not working in Integration Test <p>We have a simple method that gets all of a specific domain object where a property equals a hard coded string. This method is within MyDomainService.</p> <pre><code>def List&lt;MyDomain&gt; getAllDomain() { List resultList def criteria = MyDomain.createCriteria() resultList = criteria.list() { eq('property1', 'READY') } return resultList } </code></pre> <p>We also are writing a simple integration test for this method. The test is as follows.</p> <pre><code>void testGetAllDomain() { List original = MyDomain.list() original.each{ it.property1 = 'NOTREADY' it.save(flush:true) } def result = MyDomainService.getAllDomain() assertEquals 0, result.size() //All objects should be set to NOTREADY, and not retrieved. THIS is failing. } </code></pre> <p>I have tried setting </p> <pre><code>def transactional = false </code></pre> <p>and leaving my code as is. I tried setting transactional to false and wrapping the code in .withTransaction{}. I also tried the standard config and that didn't work. What I have noticed is that if I do</p> <pre><code>def List&lt;MyDomain&gt; getAllDomain() { List original = MyDomain.list() original.each{ it.property1 = 'NOTREADY' it.save(flush:true) } List resultList def criteria = MyDomain.createCriteria() resultList = criteria.list() { eq('property1', 'READY') } return resultList } </code></pre> <p>then the results come back as expected. This makes me believe it has something to do with the transaction within the integration test. Any ideas?</p>