bito-code-review[bot] commented on PR #16521:
URL: https://github.com/apache/grails-core/pull/16521#issuecomment-5997086874

   <!-- Bito Reply -->
   Moving `proxyHandler.unwrap(...)` inside the `hibernateTemplate.execute { 
... }` callback is a correct and recommended approach. This ensures that any 
proxy initialization triggered by `unwrap()` occurs within the active Hibernate 
session, preventing potential `LazyInitializationException` errors that could 
arise if the proxy is accessed after the session has been closed.
   
   
**grails-data-hibernate7/core/src/main/groovy/org/grails/orm/hibernate/HibernateGormStaticApi.groovy**
   ```
   (D) hibernateTemplate.execute { Session session -> 
                   proxyHandler.unwrap(session.find(persistentEntity.javaClass, 
id))
               }
   ```


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to