-
Notifications
You must be signed in to change notification settings - Fork 1.4k
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
@PreDestroy does not work #5420
Comments
@PreDestroy only work with singleton scoped bean. |
@halibobo1205 |
@lxcmyf |
System information
OS : Mac OS X
JVM : Oracle Corporation 1.8.0_321 x86_64
Git : 9e95599
Version : 4.7.2
Code : 18031
OS : Linux
JVM : Red Hat, Inc. 1.8.0_302 amd64
Git : 9e95599
Version : 4.7.2
Code : 18031
Expected behaviour
The PreDestroy annotation is used on methods as a callback notification to signal that the instance is in the process of being removed by the container. The method annotated with PreDestroy is typically used to release resources that it has been holding. This annotation MUST be supported by all container managed objects that support PostConstruct except the application client container in Java EE 5.
As documented in Bean.destroyMethod:
According to DisposableBeanAdapter.inferDestroyMethodIfNecessary:
When the process receives the
kill -15
signal, the @PreDestroy qualified method should be executed.Actual behaviour
@PreDestroy
does not workSteps to reproduce the behaviour
Terminate the process with
kill -15
.Backtrace
The text was updated successfully, but these errors were encountered: