JDBC connection pool should be closed on shutdown/restart (fix attached)
geeksville opened this issue · comments
Hi,
I noticed that if I did a container:restart inside my sdb session the restart would fail because h2 was not being shutdown. The fix is that boneCP needs to be shutdown in the cleanup() function. (I fixed it by subclassing DefaultConfig and overriding the method, but you could just add the line to DefaultConfig.close())
override def loadConfig(config: Map[String, Any]) = new DefaultConfig(overrideSettings = config) {
override def cleanup = {
super.cleanup
// Bug in scala active record - they are forgetting to shutdown the connection pool
pool.shutdown()
}
}
PS: Thanks for the great library!