Will Spring destroy singletons in a specifc order upon exit? This is important in a scenario like this:
- Bean A has a dependency on Bean B
- Bean A's destroy-method refers to the instance of Bean B that it holds
- I want to make sure that Bean B's destroy-method hasn't been called yet
A realistic use case might be that Bean B is a database connection and Bean A wants to log to the database the fact that it is being destroyed.
In other words, the order of destruction of beans should be the inverse of the order of creation. Is this the case?
Thanks in advance.


Reply With Quote