Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

DataSource url property is ignored when there is no connection pool #19192

Closed
filiphr opened this issue Nov 29, 2019 · 2 comments
Closed

DataSource url property is ignored when there is no connection pool #19192

filiphr opened this issue Nov 29, 2019 · 2 comments
Assignees
Labels
type: bug A general bug
Milestone

Comments

@filiphr
Copy link
Contributor

filiphr commented Nov 29, 2019

When there are multiple drivers on the classpath (e.g. h2 and postgres) and no connection pool is present. Then spring.datasource.url is not used, instead the embedded database is used.

I would expect that the datasource that is created is connected with the provided datasource URL.

I was debugging this a bit and from the DataSourceAutoConfiguration the PooledDataSourceConfiguration is not active since there is no connection pool. This means that EmbeddedDatabaseConfiguration would be active leading to EmbeddedDataSourceConfiguration to create the datasource and that one then creates EmbeddedDatabase.

This has clearly been an error on our side (forgetting to add the connection pool).

I'd suggest that the EmbeddedDataSourceConfiguration is actually renamed to NonPooledDataSourceConfiguration and then based on whether a datasource url is defined or not a SimpleDriverDataSource is used or the current behaviour is kept.

@spring-projects-issues spring-projects-issues added the status: waiting-for-triage An issue we've not yet triaged label Nov 29, 2019
@philwebb philwebb added the for: team-attention An issue we'd like other members of the team to review label Dec 2, 2019
@philwebb philwebb added type: bug A general bug and removed for: team-attention An issue we'd like other members of the team to review status: waiting-for-triage An issue we've not yet triaged labels Dec 13, 2019
@philwebb philwebb added this to the 2.1.x milestone Dec 13, 2019
nosan added a commit to nosan/spring-boot that referenced this issue Jan 8, 2020
nosan added a commit to nosan/spring-boot that referenced this issue Jan 8, 2020
nosan added a commit to nosan/spring-boot that referenced this issue Jan 8, 2020
nosan added a commit to nosan/spring-boot that referenced this issue Jan 8, 2020
nosan added a commit to nosan/spring-boot that referenced this issue Jan 8, 2020
nosan added a commit to nosan/spring-boot that referenced this issue Jan 8, 2020
nosan added a commit to nosan/spring-boot that referenced this issue Jan 9, 2020
@wilkinsona
Copy link
Member

Closing in favour of #19576.

@wilkinsona wilkinsona removed this from the 2.1.x milestone Jan 14, 2020
@wilkinsona wilkinsona added the status: superseded An issue that has been superseded by another label Jan 14, 2020
nosan added a commit to nosan/spring-boot that referenced this issue Jan 22, 2020
@snicoll snicoll reopened this Feb 18, 2020
@snicoll snicoll removed the status: superseded An issue that has been superseded by another label Feb 18, 2020
@snicoll snicoll added this to the 2.1.13 milestone Feb 18, 2020
@snicoll snicoll self-assigned this Feb 18, 2020
@filiphr
Copy link
Contributor Author

filiphr commented Feb 19, 2020

Thanks for fixing this @snicoll.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type: bug A general bug
Projects
None yet
Development

No branches or pull requests

5 participants