matrei opened a new pull request, #16457:
URL: https://github.com/apache/grails-core/pull/16457

   Fixes #16454
   
   The configuration metadata grails-core publishes for `dataSource.*` stated 
defaults that an application without `dataSource` configuration does not get. 
`configReport` and IDE completion showed them as the defaults.
   
   The metadata now describes what an application gets when nothing is 
configured:
   
   | Property | Was | Now |
   |---|---|---|
   | `dataSource.url` | `jdbc:h2:mem:devDb` | 
`jdbc:h2:mem:grailsDB;LOCK_TIMEOUT=10000` |
   | `dataSource.dbCreate` | `create-drop (dev), none (prod)` | `none` (the 
description says it applies in every environment and that generated 
applications set it per environment) |
   | `dataSource.username` | `sa` | no default; the description says 
connections are opened without a username and that H2 applications usually set 
`sa` |
   | `dataSource.password` | `""` | no default; the description says 
connections are opened without a password and that H2 applications usually set 
an empty one |
   | `dataSource.driverClassName` | `org.h2.Driver` | no default; the 
description says the connection pool derives the driver from the URL |
   | `dataSource.jmxExport` | `true` | `false`; the description says it only 
applies to Tomcat JDBC pool DataSources with `jmxEnabled` set in their 
properties |
   
   `DataSourceGrailsPlugin` only registers the Tomcat JDBC pool MBean exporter 
when `dataSource.jmxExport` is `true` (the default has been `false` since at 
least 7.0.x). The DataSource section of the guide described `jmxExport` the 
other way round, as a switch to turn off registration that otherwise happens. 
It now says that `true` enables it and that it defaults to `false`.
   
   The "Automatic Database Migration" section of the guide said `dbCreate` 
defaults to `create-drop` in development. It now says the default is `none` in 
every environment and that a newly created application sets `create-drop` for 
development in `application.yml`.
   
   `DataSourceConfigurationMetadataSpec` (grails-datamapping-core) reads the 
published `spring-configuration-metadata.json` from the classpath and checks 
each documented `dataSource.*` default against the settings 
`DataSourceSettingsBuilder` builds from an empty configuration, and that 
properties without a default (`driverClassName`, `username`, `password`) 
document none. Against the old metadata, the url, dbCreate, driverClassName, 
username and password entries fail.
   
   `DataSourceGrailsPluginSpec` (grails-datasource) now checks that the MBean 
exporter is registered only when `dataSource.jmxExport` is `true`, and that the 
published `jmxExport` default matches what the plugin does when the property is 
unset. To run these checks, `tomcat-jdbc` is now a test runtime dependency of 
grails-datasource.
   


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