The GitHub Actions job "CI - Groovy Joint Validation Build" on 
grails-core.git/fix/where-connection-routing has failed.
Run started by GitHub user jamesfredley (triggered by jamesfredley).

Head commit for run:
7ae3260c47efcbe7e217551076a12006564afb7d / James Fredley 
<[email protected]>
Fix @Where and DetachedCriteria query methods ignoring 
@Transactional(connection)

Data Service methods using @Where annotations or DetachedCriteria-based queries
(count, list, findBy*) were ignoring the class-level @Transactional(connection)
annotation, causing queries to execute against the default datasource instead of
the specified connection.

Root cause: Both AbstractWhereImplementer and
AbstractDetachedCriteriaServiceImplementor called 
findConnectionId(newMethodNode)
instead of findConnectionId(abstractMethodNode). The newMethodNode belongs to 
the
generated $ServiceImplementation class which lacks the @Transactional 
annotation,
while abstractMethodNode belongs to the original interface/abstract class where
the annotation is declared.

Additionally, in AbstractWhereImplementer the build() call was placed after
withConnection(), but DetachedCriteria.clone() (called internally by build) does
not copy the connectionName field, causing the connection setting to be lost.
Fixed by reordering build() before withConnection().

Fixes #15416

Assisted-by: Claude Code <[email protected]>

Report URL: https://github.com/apache/grails-core/actions/runs/22204290202

With regards,
GitHub Actions via GitBox

Reply via email to