tag:blogger.com,1999:blog-5507223161490572934.post4913974969105477986..comments2024-03-29T16:12:50.613+08:00Comments on Tropical Software Observations: Grails 1.0.4 "no Session" ErrorBacchus Dhttp://www.blogger.com/profile/02856305235432641508noreply@blogger.comBlogger3125tag:blogger.com,1999:blog-5507223161490572934.post-50513778991324978942010-09-25T04:31:48.168+08:002010-09-25T04:31:48.168+08:00There's a section about this problem in the bo...There's a section about this problem in the book Grails Persistence with GORM and GSQL ($14 ebook, $20 book). The section is titled Lazy Initialization and the Grails Session. The recommended solution is this:<br /><br />def hibSession = sessionFactory.currentSession <br /><br />user = hibSession.merge(user) <br /><br />I suppose that using the user.refresh or User.get approach from this blog post results in re-reading the object from the DB and thus losing any changes that have been made to the object.David Gelbarthttps://www.blogger.com/profile/09930813569213912228noreply@blogger.comtag:blogger.com,1999:blog-5507223161490572934.post-32576247997263791192010-09-25T01:49:09.653+08:002010-09-25T01:49:09.653+08:00The message thread link above is broken now. Try ...The message thread link above is broken now. Try here:<br /><br />http://osdir.com/ml/lang.groovy.grails.user/2008-11/msg01092.htmlDavid Gelbarthttps://www.blogger.com/profile/09930813569213912228noreply@blogger.comtag:blogger.com,1999:blog-5507223161490572934.post-55183593939307970592010-09-25T01:35:28.545+08:002010-09-25T01:35:28.545+08:00Thanks, this is potentially very helpful. I could...Thanks, this is potentially very helpful. I couldn't find this page when Googling the full exception so to help others, here it is: org.hibernate.LazyInitializationException: could not initialize proxy - no SessionDavid Gelbarthttps://www.blogger.com/profile/09930813569213912228noreply@blogger.com