Couldn't find a destroy method named 'close' on bean with name 'dataSource'
Joined: Apr 24, 2004
Hello, I am developing my first Spring app and I came with the following warning:
Here is a snippet from my spring config file corresponding to this warning:
Can anyone please advise what to do about it? By the way I use Mysql and Jpa and Hibernate as jpa implementation.
Should I worry about it? Thanks in advance, Julien.
Joined: Jan 28, 2008
The destroy-method="close" is needed when you are using apache commons DBCP's BasicDataSource or C3P0's ComboPooledDataSource to shutdown the data source immediately when the spring application shuts down. This is not needed in the DriverManagerDataSource. This class doesn't even have any form of destroy method. Spring manages that for you. Just remove the destroy-method attribute from your bean definition.