Skip to content

Use SimpleDriverDataSource when creating a Liquibase-specific DataSource #24944

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

Closed
wmilewski opened this issue Jan 20, 2021 · 3 comments
Closed
Assignees
Labels
type: enhancement A general enhancement
Milestone

Comments

@wmilewski
Copy link

Hi,

When Liquibase creates a new DataSource instance, the connection pool size is always 10, presumably a default value. This is not always desirable. It is possible to specify a custom DataSource for Liquibase to use, but setting it up is not trivial, at least for newcomers to SpringBoot and Liquibase. I think it would be much easier to allow developers to change the pool size by setting a custom value e.g. in the application.properties file.

Would there be an interest in adding this new configuration property? If yes, I'd be happy to try and provide a PR.

@spring-projects-issues spring-projects-issues added the status: waiting-for-triage An issue we've not yet triaged label Jan 20, 2021
@wilkinsona
Copy link
Member

wilkinsona commented Jan 20, 2021

This was proposed and rejected in the past in favour of @LiquibaseDataSource. Rather than adding more properties, we could avoid using a connection pool altogether. This is what Flyway does, creating an instance of its DriverDataSource when configured with a JDBC URL, username and password. We could do similar using Spring Framework's SimpleDriverDataSource.

Let's see what the rest of the team thinks.

We already have support for falling back to SimpleDriverDataSource when there's no connection pool available. This branch changes the auto-configuration so that it uses SimpleDriverDataSource whenever a DataSource is being created.

@wilkinsona wilkinsona added the for: team-attention An issue we'd like other members of the team to review label Jan 20, 2021
@wmilewski
Copy link
Author

Thanks @wilkinsona. It makes sense now that I understand this is by design. An alternative could be to improve the documentation, perhaps with a code sample.

@philwebb philwebb added type: enhancement A general enhancement 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 Jan 25, 2021
@philwebb philwebb added this to the 2.5.x milestone Jan 25, 2021
@wilkinsona wilkinsona changed the title Liquibase DataSource: configure connection pool size in application properties Use SimpleDriverDataSource when creating a Liquibase-specific DataSource Jan 25, 2021
@wilkinsona
Copy link
Member

We're going to switch to using SimpleDriverDataSource when we create a Liquibase-specific DataSource. We can't see any need for a connection pool to be used and this will align the behaviour with what happens when using Flyway.

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

No branches or pull requests

4 participants