Skip to content

Adds spring.datasource.lazy-connection property to enable Lazy DataSource support #15968

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
wants to merge 1 commit into from

Conversation

nosan
Copy link
Contributor

@nosan nosan commented Feb 15, 2019

This commit adds spring.datasource.lazy-connection property into a DataSourceProperties class to enable a LazyConnectionDataSourceBeanPostProcessor. BeanPostProcessor wraps an auto-configured DataSource in a LazyConnectionDataSourceProxy. It will be added only if a
spring.datasource.lazy-connection property has true and a LazyConnectionDataSourceProxy
class is present. The default value of the spring.datasource.lazy-connection property is false, which means a lazy-connection feature is disabled by default.

see gh-15480

Note! LazyConnectionDataSourceBeanPostProcessor it is being invoked after DataSourceInitializerPostProcessor (I'm not sure that is the right behaviour)

Thanks in advance.

@spring-projects-issues spring-projects-issues added the status: waiting-for-triage An issue we've not yet triaged label Feb 15, 2019
@nosan nosan force-pushed the gh-15480 branch 3 times, most recently from b2d83f7 to 4f8109f Compare February 21, 2019 08:31
a DataSourceProperties class to enable a LazyConnectionDataSourceBeanPostProcessor.
BeanPostProcessor wraps an auto-configured DataSource in a LazyConnectionDataSourceProxy.
It will be added only if a spring.datasource.lazy-connection property has true
and a LazyConnectionDataSourceProxy class is present.
The default value of the spring.datasource.lazy-connection property is false,
which means a lazy-connection feature is disabled by default.

closes spring-projectsgh-15480
@wilkinsona
Copy link
Member

Thanks for the PR. I'm not sure that a bean post-processor is the best way to implement this. If there's a second auto-configured DataSource, it will also be wrapped in a LazyConnectionDataSourceProxy and I don't think it should be.

I think we'll need to do something that means we can be certain that it's only the auto-configured data source that will be wrapped. We also need to make a decision about whether or not the wrapping should be enabled by default. Let's use #15480 to do that. Thanks anyway.

@wilkinsona wilkinsona closed this Feb 26, 2019
@wilkinsona wilkinsona added status: declined A suggestion or change that we don't feel we should currently apply and removed status: waiting-for-triage An issue we've not yet triaged labels Feb 26, 2019
@nosan nosan deleted the gh-15480 branch February 26, 2019 13:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
status: declined A suggestion or change that we don't feel we should currently apply
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants