gsartori opened a new issue, #16801:
URL: https://github.com/apache/grails-core/issues/16801

   ### Expected Behavior
   
   ### Summary
   
   I am sorry for such a bad issue text, I cannot do better at the moment but 
the test should be useful.
   
   This test displays the issue:
   
https://github.com/dueuno-projects/dueuno/blob/grails-9-multitenant-issue-spec/app-test/src/test/groovy/apptest/gormissue/GormTenantTransactionManagerIssueSpec.groovy
   
   The real issue I have is in a Dueuno service, codex wrote a workaround but 
it says it's a GORM issue.
   
   The full service is this:
   
https://github.com/dueuno-projects/dueuno/blob/grails-9-multitenant-issue-spec/dueuno-core/grails-app/services/dueuno/tenant/TenantPropertyService.groovy
   
   This is the isolated workaround (just in case it may help):
   
   ```
       // This is a workaround for an issue with grails 9 tenants
       // Generated by AI, I have no clue what it does but it works
       PlatformTransactionManager getTransactionManager() {
           Serializable tenantId = CurrentTenantHolder.get(targetDatastore)
           if (tenantId != null && tenantId.toString() != 
ConnectionSource.DEFAULT) {
               PlatformTransactionManager tenantTransactionManager = 
GormRegistry.instance.findSingleTransactionManager(tenantId.toString())
               if (tenantTransactionManager) return tenantTransactionManager
           }
   
           return 
GormRegistry.instance.findTransactionManager(TenantPropertyService)
       }
   ```
   
   ### Actual Behaviour
   
   _No response_
   
   ### Steps To Reproduce
   
   _No response_
   
   ### Environment Information
   
   - Grails: 9.0.0-SNAPSHOT
   - GORM: Grails Data Hibernate 5, 9.0.0-SNAPSHOT (managed by the Grails BOM)
   - Groovy: 5.1.3
   - Java runtime: OpenJDK 25.0.4.1 (JetBrains Runtime)
   - Gradle: 9.8.2 (Gradle Wrapper)
   - OS: macOS, Darwin 27.2.0, arm64
   
   ### Example Application
   
   
https://github.com/dueuno-projects/dueuno/blob/grails-9-multitenant-issue-spec/app-test/src/test/groovy/apptest/gormissue/GormTenantTransactionManagerIssueSpec.groovy
   
   ### Version
   
   9.0.0-SNAPSHOT


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