jamesfredley commented on code in PR #15406:
URL: https://github.com/apache/grails-core/pull/15406#discussion_r2829647390
##########
grails-data-hibernate5/docs/src/docs/asciidoc/multipleDataSources/dataSourceNamespaces.adoc:
##########
@@ -61,3 +61,5 @@ def results = c.list {
like('code','995%')
}
----
+
+TIP: The namespace syntax (e.g., `ZipCode.auditing.get(42)`) uses dynamic
dispatch and is not compatible with `@CompileStatic`. For statically compiled
code, use `GormEnhancer.findStaticApi(ZipCode, 'auditing')` to obtain a
`GormStaticApi` handle with the same methods routed to the specified
datasource, or use a Data Service with `@Transactional(connection =
'auditing')` for automatic routing. See the
<<dataServicesMultipleDataSources,Data Services and Multiple Datasources>>
section for the full pattern.
Review Comment:
I put this back in draft, let's see where we land after fixing the few open
bugs and hopefully there is a normal path that is fully unlocked to do this
with `@CompileStatic`
--
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]