0

Should I shut down the data source mannully when my program exits? If it is, then what is the best practice to close the source, for example, if the kill cmd is issued?

xuanzhui
  • 1,300
  • 4
  • 12
  • 30

1 Answers1

0

shutdown() or close() is essential at application termination, otherwise you will leave database resources in use.

Solution found in old issue to call close on your DataSource:

you can simply cast to Closeable and call close

Ori Marko
  • 56,308
  • 23
  • 131
  • 233