I have a background thread in my web application. So let's assume I have somewhere in my code BackgroundThread.getInstance().start() which starts only once BackgroundThread.
BackgroundThread uses Drivermanager.getconnection to get a connection, do something, close the connection and than wait 10 seconds. Then in the infinite loop it repeats the process.
But if I do glassfish redeploy I'm starting to get MySQLNonTransientConnectionException: could not create connection
I'm not sure if I can reproduce the problem without redeploying glassfish.
Any idea what could be causing problem and how to avoid it?