low-he-th opened a new issue, #15707:
URL: https://github.com/apache/grails-core/issues/15707

   I recently migrated a multi-module application from Grails 6 to Grails 7.0.1 
and am facing a MongoDB lazy-loading issue during GSP rendering.
   
   Project structure:
   Main Application
   - Module 1 (contains MongoDB domain classes such as Test, Test1, etc.)
   - Module 2 (uses domain classes from Module 1)
   
   In a GSP page, I have something like:
   _test1 class is a Foreign Key(FK) in test class_
   ```
   <g:each in="${testList}" var="test">
       <option value="${test.id}">
           ${test?.test1?.name}
       </option>
   </g:each>
   
   ```
   After migrating to Grails 7, the page throws the following error:
   No datastore session found. Call Datastore.connect(..) before calling 
Datastore.getCurrentSession()Interestingly, if I access the association in the 
controller before rendering the GSP, or if I convert the data to DTOs/maps and 
pass that to the view, the page works correctly.
   
   1. Has datastore session handling during GSP rendering changed in Grails 7 
compared to Grails 6?
   2. Is there a recommended global solution for this issue instead of manually 
initializing associations or creating DTOs for every page?
   3. Has anyone faced similar issues in multi-module Grails 7 applications 
using MongoDB references?


-- 
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