Connections may be left open after the datasource is closed as the housekeeping executor may not execute all the scheduled tasks.
This can happen, for instance, when the JVM is shutting down as all threads stop as soon as the shutdown hooks complete.