codeconsole commented on PR #16369:
URL: https://github.com/apache/grails-core/pull/16369#issuecomment-5780415133
@matrei #16368 is closed, and this PR now carries all of it; the description
covers everything.
Your `@Transactional(connection)` P3 is fixed here rather than in a
follow-up, in 190ac9c388. A method annotated `@Transactional(connection =
'books')`, and the `TransactionService` of the `books` datastore, now route the
calls on every domain class mapped to `books` to it, as
`Book.books.withTransaction { }` does for `Book`. The annotation names no
class, so a class with no mapping for `books` keeps its own connection rather
than being sent somewhere it cannot be stored. `MultipleDataSourceSpec` checks
both sides with a class mapped only to the default connection, and both
Hibernate `MultipleDataSourceConnectionsSpec`s save through the existing
`@Transactional(connection = "books")` `TestService`.
The transform passes the annotation's connection to
`GrailsTransactionTemplate`, which runs `execute` and `executeAndRollback` in
that scope. The scopes are now a stack, so a block for one class and a block
for a whole connection nest in the order they were opened. The guide paragraph
that said the annotation does not route is corrected, and section 72 and the
MongoDB and Neo4j notes include it.
Run on the six affected modules and the Hibernate 5 and 7 multi-datasource
example apps: 7,458 tests, 0 failures.
--
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]