Currently, there is no way to add additional configuration to the URL when we want to use generateUniqueName=true
For example:
- when we want to use MODE=MYSQL at h2 URL
- It is not possible since the URL hardcoded to jdbc:h2:mem:%s;DB_CLOSE_DELAY=-1;DB_CLOSE_ON_EXIT=FALSE
- At DataSourceProperties it can't generateUniqueName when we fill in URL value.
Workaround:
- Extend DataSourceProperties
- Override determineUrl
Preferred solution:
- Some kind of additional url-suffix property at DataSourceProperties
- That will be appended to EmbeddedDatabaseConnection url.
Comment From: philwebb
@ls-rein-martha I wonder if the random property source would allow you do define the URL entirely. Have you tried something like this?
spring.datasource.url=jdbc:h2:mem:${random.uuid};DB_CLOSE_DELAY=-1;DB_CLOSE_ON_EXIT=FALSE;MODE=MYSQL
Comment From: ls-rein-martha
Ah.. you are right, why I didn't think of that workaround. Yes, @philwebb it works. Thank you very much. I will close this ticket.