codeconsole commented on PR #16369:
URL: https://github.com/apache/grails-core/pull/16369#issuecomment-5781816457
The Hibernate 7 functional shards were failing on my
`@Transactional(connection = ...)` routing, fixed in 62c7b4a139.
`SchemaPerTenantSpec` and `DatabasePerTenantSpec` use
`@Rollback('moreBooks')`, where `moreBooks` is a tenant rather than a
datasource, and assert that a call with no tenant bound still throws
`TenantNotFoundException`. The routing treated that name as a connection, so
the call resolved that tenant's API and returned a count instead. In SCHEMA
mode the tenant is a schema, and in DATABASE mode it is a connection, but in
neither does a transaction opened for it say which tenant the operations inside
belong to: that is what the tenant context says.
The scope for every class on a connection now passes over a multi-tenant
class. Naming the connection on the class routes it as it always did, and
`ScopedTenantBook.bar.count()` is asserted alongside.
`ConnectionScopeMultiTenancySpec` covers the contract at unit level, since the
two applications that caught this are not in the module test set I had been
running; it fails without the change.
Also here: 65b6851931, which makes the one CRaC limitation audible. Only the
`MongoConnectionSource` the stock factory creates can be given the client built
for a restore, so a custom factory's own kind goes on handing out the closed
one. The restore now warns, naming the connection and what a factory should
return, and the factory documents the contract.
Run for this: the eight affected modules and thirteen Hibernate 5 and 7
example applications, including schema-per-tenant and database-per-tenant on
both: 7,521 tests, 0 failures, plus `codeStyle`, the five guides and `rat`.
--
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]