• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Couldn't find a destroy method named 'close' on bean with name 'dataSource'

 
Ranch Hand
Posts: 384
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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.
 
Ranch Hand
Posts: 471
Mac OS X Hibernate Spring
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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.
 
Julien Martin
Ranch Hand
Posts: 384
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Will do.
Thanks a lot!
Julien.
reply
    Bookmark Topic Watch Topic
  • New Topic