{"action":"created","issue":{"url":"https://api.github.com/repos/grails/grails-data-mapping/issues/570","labels_url":"https://api.github.com/repos/grails/grails-data-mapping/issues/570/labels{/name}","comments_url":"https://api.github.com/repos/grails/grails-data-mapping/issues/570/comments","events_url":"https://api.github.com/repos/grails/grails-data-mapping/issues/570/events","html_url":"https://github.com/grails/grails-data-mapping/issues/570","id":114834980,"number":570,"title":"GORM inside bootstrap doesn't always work","user":{"login":"amadfida","id":2160973,"avatar_url":"https://avatars.githubusercontent.com/u/2160973?v=3","gravatar_id":"","url":"https://api.github.com/users/amadfida","html_url":"https://github.com/amadfida","followers_url":"https://api.github.com/users/amadfida/followers","following_url":"https://api.github.com/users/amadfida/following{/other_user}","gists_url":"https://api.github.com/users/amadfida/gists{/gist_id}","starred_url":"https://api.github.com/users/amadfida/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/amadfida/subscriptions","organizations_url":"https://api.github.com/users/amadfida/orgs","repos_url":"https://api.github.com/users/amadfida/repos","events_url":"https://api.github.com/users/amadfida/events{/privacy}","received_events_url":"https://api.github.com/users/amadfida/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/grails/grails-data-mapping/labels/neo4j","name":"neo4j","color":"fbca04"}],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":10,"created_at":"2015-11-03T14:58:40Z","updated_at":"2015-11-03T17:09:46Z","closed_at":"2015-11-03T17:09:46Z","body":"If we have a service call and then GORM code (creating some domain objects) inside Init from bootstrap, the GORM changes dont' commit to database. For example consider following code,\r\n\r\n```java\r\n    def init = { servletContext ->\r\n                uefaService.initialize()\r\n\t\tinitEufa()    \t        \r\n    }\r\n```\r\n\r\nAny changes made in `initEufa()` method are not persisted, though there is no error thrown. However if we change the order and move the service call after `initEufa()` call, the changes are committed.\r\n\r\nI have attached a sample app, to demonstrate that. You can just run the app, and then either using neo4j-shell or \r\n\r\n`http GET http://localhost:8080/neo4j-app/clubs` see if the records were created.\r\n\r\n\r\n"},"comment":{"url":"https://api.github.com/repos/grails/grails-data-mapping/issues/comments/153420422","html_url":"https://github.com/grails/grails-data-mapping/issues/570#issuecomment-153420422","issue_url":"https://api.github.com/repos/grails/grails-data-mapping/issues/570","id":153420422,"user":{"login":"amadfida","id":2160973,"avatar_url":"https://avatars.githubusercontent.com/u/2160973?v=3","gravatar_id":"","url":"https://api.github.com/users/amadfida","html_url":"https://github.com/amadfida","followers_url":"https://api.github.com/users/amadfida/followers","following_url":"https://api.github.com/users/amadfida/following{/other_user}","gists_url":"https://api.github.com/users/amadfida/gists{/gist_id}","starred_url":"https://api.github.com/users/amadfida/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/amadfida/subscriptions","organizations_url":"https://api.github.com/users/amadfida/orgs","repos_url":"https://api.github.com/users/amadfida/repos","events_url":"https://api.github.com/users/amadfida/events{/privacy}","received_events_url":"https://api.github.com/users/amadfida/received_events","type":"User","site_admin":false},"created_at":"2015-11-03T17:09:46Z","updated_at":"2015-11-03T17:09:46Z","body":"OK with @Transactional on controller or method - mixing of services and gorm inside method works - but not without, which i assume is the correct behaviour."}}