先贴出一段话:
-
The name of the custom destroy method to invoke on bean factory shutdown. The method must have no arguments, but may throw any exception. Note: Only invoked on beans whose lifecycle is under the full control of the factory - which is always the case for singletons, but not guaranteed for any other scope.
- 这是说你的bean工厂关闭的时候,自定义的销毁方法会被调用,这时你的连接池什么的都没有了,你就连接不了数据库;destroy-method="close"不写也没有关系;