HSQLDB Timer Thread still running when servlet is destroyed

2020-04-17 servlets hsqldb

I am developing a servlet running on Tomcat. While I am still in the early stages of development, I am testing against a flat-file HSQLDB database. Once I get closer to production readiness, I will move to HSQLDB in server mode (or maybe an entirely different DBMS, though this is yet to be decided).

Now every time Tomcat reloads the servlet (I am developing with Eclipse), I get the following message:

The web application [subscription-manager] appears to have started a thread named [HSQLDB Timer @1192be13] but has failed to stop it.

Answers indicate that I should issue a SHUTDOWN command against the database to fix this—fair enough as long as it is only a flat-file DB but a recipe for disaster once I move to server mode (where the database will be shared between multiple components).

Should I just ignore this warning for now and expect it to go away when I switch to server mode, or will the HSQLDB driver still spawn the timer thread when connecting to an instance running in server mode? And if it does, what would I need to do?

Answers

You can ignore the warning if you are going to switch to server mode.

The driver does not spawn the Timer thread when connected to the database server. There will be a Timer thread on the server process.

Related