codeconsole commented on PR #16369:
URL: https://github.com/apache/grails-core/pull/16369#issuecomment-5781109888

   Five more bugs fixed here, each in its own commit, rather than in follow-ups:
   
   - **077f33c2c9** — the configuration metadata stated defaults the settings 
do not have: `decimalType` as `false` where it is `true`, and `localhost` for 
the host and url where the driver's own `127.0.0.1` applies. A spec now 
compares the metadata with the settings, so the next mismatch fails.
   - **12497cfb51** — `recreateOnConflict` passed by an 
`IndexKeySpecsConflict`, where the declared name is held by an index on 
different keys. It now recreates that index where recreating is declared, and 
otherwise says which name is taken instead of repeating the driver's message.
   - **fdd67c9244** — where MongoDB's properties are present but the 
application declares no `MongoClient` bean, the auto-configuration builds the 
client itself and handed it to GORM as if the application had supplied it, so a 
checkpoint kept its sockets. A datastore can now be built around a 
`Supplier<MongoClient>`, owning what the supplier builds and building the 
replacement the restore needs the same way; that client cannot be rebuilt from 
`grails.mongodb` settings, which is why the supplier is what it keeps.
   - **07f68726a4** — `withNewSession(tenantId)` on a static API opened the 
session for that tenant without binding it, so the calls inside read whichever 
tenant the resolver reported. The other tenant entry points (`withTenant(id) { 
}`, `withTenant(id).withTransaction { }`, `Tenants.withId`) already routed 
correctly.
   - **c82dd69b25** — inside a `withConnection` block, a save of a class mapped 
only to named connections went to the block's connection, because the resolver 
picked the datastore whose session the block had opened. Each class now keeps 
the connection it is mapped to. Outside a block the bound-session heuristic is 
unchanged, since that is what routes calls made inside a session opened on the 
datastore itself. A class mapped to the default connection was never affected, 
which is why this looked arbitrary.
   
   RxGORM's `withConnection` has the same routing gap as MongoDB's and Neo4j's 
had, and is deliberately not changed: `grails-datamapping-rx` is commented out 
of `settings.gradle` ("until this can be finished being ported to the current 
Grails release, we are disabling"), so it is neither built nor publishable, and 
the change could not be compiled or tested.
   
   Run on the eight affected modules and the seven Hibernate 5 and 7 
multi-datasource example apps: 7,490 tests, 0 failures. `codeStyle`, the five 
guides and `rat` are clean, and each new test fails without its fix.
   


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