{"action":"opened","issue":{"url":"https://api.github.com/repos/grails/grails-data-mapping/issues/562","labels_url":"https://api.github.com/repos/grails/grails-data-mapping/issues/562/labels{/name}","comments_url":"https://api.github.com/repos/grails/grails-data-mapping/issues/562/comments","events_url":"https://api.github.com/repos/grails/grails-data-mapping/issues/562/events","html_url":"https://github.com/grails/grails-data-mapping/issues/562","id":109943399,"number":562,"title":"could not initialize proxy - no Session","user":{"login":"kasonyang","id":6822040,"avatar_url":"https://avatars.githubusercontent.com/u/6822040?v=3","gravatar_id":"","url":"https://api.github.com/users/kasonyang","html_url":"https://github.com/kasonyang","followers_url":"https://api.github.com/users/kasonyang/followers","following_url":"https://api.github.com/users/kasonyang/following{/other_user}","gists_url":"https://api.github.com/users/kasonyang/gists{/gist_id}","starred_url":"https://api.github.com/users/kasonyang/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kasonyang/subscriptions","organizations_url":"https://api.github.com/users/kasonyang/orgs","repos_url":"https://api.github.com/users/kasonyang/repos","events_url":"https://api.github.com/users/kasonyang/events{/privacy}","received_events_url":"https://api.github.com/users/kasonyang/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":0,"created_at":"2015-10-06T06:37:10Z","updated_at":"2015-10-06T06:37:10Z","closed_at":null,"body":"here is my code:Gorm.groovy\r\n```java\r\nimport grails.orm.bootstrap.*\r\nimport grails.persistence.*\r\nimport org.springframework.jdbc.datasource.DriverManagerDataSource\r\nimport org.h2.Driver\r\n\r\ninit = new HibernateDatastoreSpringInitializer(Person,Book)\r\ndef dataSource = new DriverManagerDataSource(Driver.name, \"jdbc:h2:prodDb;MVCC=TRUE;LOCK_TIMEOUT=10000;DB_CLOSE_ON_EXIT=FALSE\", 'sa', '')\r\ninit.configureForDataSource(dataSource)\r\n\r\n//save person\r\ndef p = new Person()\r\np.name = 'kk'\r\np.save()\r\n//assign person to book then save book\r\ndef b = new Book()\r\nb.name = \"bb\"\r\nb.author = p\r\nb.save()\r\n//load book and get it's author\r\ndef bb = Book.load(b.id)\r\nprintln bb.author  //here throws exception\r\n\r\n@Entity\r\nclass Person {\r\n\tString name\r\n\tstatic constraints = {\r\n\t\tname blank:false\r\n\t}\r\n}\r\n@Entity\r\nclass Book{\r\n\tString name\r\n\tPerson author\r\n}\r\n```\r\nIt throws a exception when running it:\r\n```java\r\nCaught: org.hibernate.LazyInitializationException: could not initialize proxy - no Session\r\norg.hibernate.LazyInitializationException: could not initialize proxy - no Session\r\n\tat org.hibernate.proxy.AbstractLazyInitializer.initialize(AbstractLazyInitializer.java:164)\r\n\tat org.hibernate.proxy.AbstractLazyInitializer.getImplementation(AbstractLazyInitializer.java:285)\r\n\tat Book_$$_jvstd35_1.getAuthor(Book_$$_jvstd35_1.java)\r\n\tat Gorm.run(Gorm.groovy:21)\r\n```\r\nwhat does it mean and why?\r\n"}}