The GitHub Actions job "Groovy Snapshot Canary Build" on grails-core.git/fix/16801-current-tenant-transactional-8.0.x has failed. Run started by GitHub user matrei (triggered by matrei).
Head commit for run: 12d875078bb6508bb3721a6d12b5477286767bb2 / Mattias Reichel <[email protected]> Look up the current tenant for the datastore it is bound for In DATABASE mode, inside Tenants.withId(tenantId), Tenants.currentId() and the other methods of Tenants that take no datastore, as well as the methods of a @CurrentTenant class that is not a data service, used the datastore of the tenant's connection rather than the one withId binds the tenant for. No tenant is bound for that datastore, so they took the tenant the tenant resolver resolves. A @CurrentTenant method then bound that tenant for it, and a @Transactional method called there failed with a TenantException, as the thread held two tenants. Without a tenant from the resolver, or with one the datastore has no connection for, the @CurrentTenant method failed with a TenantNotFoundException or a ConfigurationException. They now use the datastore of the default connection, as on 7.x. Tenants.withId(domainClass, tenantId) bound the tenant for the datastore of the tenant the resolver resolves, and failed with a ConfigurationException when that datastore has no connection for the given tenant. It now binds it for the datastore the domain class is mapped to. The getTransactionManager() that @Transactional and data services generate looked up the tenant bound for any datastore, which throws a TenantException when the thread holds different tenants for different datastores. It now looks up the tenant bound for the default datastore, or for the datastore of the data service. Fixes #16801 Report URL: https://github.com/apache/grails-core/actions/runs/41425109207 With regards, GitHub Actions via GitBox
