If you go to a page that doesn’t exist, but 404 is “thrown” and Grails tries to display my 404 error page, I get lazy initialization errors from some taglib tags that I have that run in the error layout.
Taglib is really trying to access a domain object inside another domain object, which is a has-many relationship. It can get the initial object, but when accessing this connection, it generates this lazy initialization error.
However, this does not happen when any other page is accessed correctly. Even if I try to access my error page directly. Only with 404 error.
Is there anything else in the hibernate session during this time that causes a lazy initialization error?
Is it possible that accessing what is lazily initialized in taglib is not a good idea in Grails?
source
share