-
Notifications
You must be signed in to change notification settings - Fork 38.3k
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
Introduce initialize()
method in AbstractRoutingDataSource
and AbstractRoutingConnectionFactory
#31248
Introduce initialize()
method in AbstractRoutingDataSource
and AbstractRoutingConnectionFactory
#31248
Conversation
refresh()
method in AbstractRoutingDataSource
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the proposal and PR.
Can you please also introduce a similar refresh()
method in AbstractRoutingConnectionFactory
along with a corresponding test?
Sure. I've done. Please let me know if you need anything else. Thank you for your review! |
refresh()
method in AbstractRoutingDataSource
refresh()
method in AbstractRoutingDataSource
and AbstractRoutingConnectionFactory
refresh()
method in AbstractRoutingDataSource
and AbstractRoutingConnectionFactory
initialize()
method in AbstractRoutingDataSource
and AbstractRoutingConnectionFactory
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for making the changes to AbstractRoutingConnectionFactory
as well.
After further consideration, the team has decided that we would like these new methods to be named initialize()
instead of refresh()
, since the latter implies that there is first class support for dynamic refreshes at runtime -- which is not the case.
...jdbc/src/main/java/org/springframework/jdbc/datasource/lookup/AbstractRoutingDataSource.java
Outdated
Show resolved
Hide resolved
.../main/java/org/springframework/r2dbc/connection/lookup/AbstractRoutingConnectionFactory.java
Outdated
Show resolved
Hide resolved
…ctRoutingConnectionFactory
I get it. Thank you for considering it and the kind comment! |
Situation is that you want to add DataSource to the DataSources of AbstractRoutingDataSource during runtime.
When i put a Data Source, I need to synchronize target Data Sources to resolved Data Sources.
At that time, I call
afterPropertiesSet()
as below.However,
afterPropertiesSet()
is unclear.So I suggest extract
refresh()
method. Then, intent can be exposed.Please feel free to share your opinions or advice.
thanks you.