-
Notifications
You must be signed in to change notification settings - Fork 38.2k
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
Support 'destroy method inference' for @Bean methods [SPR-8751] #13393
Labels
in: core
Issues in core modules (aop, beans, core, context, expression)
type: enhancement
A general enhancement
Milestone
Comments
Chris Beams commented
|
Chris Beams commented
|
spring-projects-issues
added
type: enhancement
A general enhancement
in: core
Issues in core modules (aop, beans, core, context, expression)
labels
Jan 11, 2019
This was referenced Jan 11, 2019
Closed
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
in: core
Issues in core modules (aop, beans, core, context, expression)
type: enhancement
A general enhancement
Chris Beams opened SPR-8751 and commented
Use case: creating a Hibernate
SessionFactory
using the native Hibernate API or Spring 3.1'sLocalSessionFactoryBuilder
:In order to properly destroy the
SessionFactory
on Spring container shutdown, the user must specify@Bean(destroyMethod="close")
:This is easy to forget and should be specified every time anyway. "destroy method inference" will detect well-known destroy methods (e.g. public no-arg
close()
methods) and automatically register them as the destroy-method against the underlying bean definition.Users may disable destroy method inference by explicitly specifying empty string (
""
) for the value ofdestroyMethod
:Issue Links:
@Bean
destroyMethod behaviorThe text was updated successfully, but these errors were encountered: