Open hugogoncalves opened 2 years ago
I totally agree with the author; calling ShutdownManager.shutdown()
doesn't make any sense to me either.
What about to register the database at Ebean's ShutdownManager instead?
// Register database at Ebean's shutdown manager (disconnects from db, shuts down all threads and so on)
ShutdownManager.registerDatabase(ebeanDatabase);
AFAIK, ShutdownManager.touch
is a no-op. As side-effect of loading this class its shutdown hook is registered at JVM but as long as it doesn't have any knowledge about the database created a few lines above, the shutdown hook won't shut the database down.
Why has been changed the ShutdownManager from touch to shutdown?
// Activate the Ebean shutdown manager (disconnects from db, shuts down all threads and so on) ShutdownManager.shutdown(); }
I had some issues with L2 caches, complains of Not able to notify caches. All complains were about tasks beiing rejected by ThreadPool from DefaultBackgroundExecutor. I changed that line toShutdownManager.touch
and my issues disapeared.