Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

NinjaEbeanDatabaseLifecycle- Shutdown Manager #18

Open
hugogoncalves opened this issue Oct 3, 2022 · 1 comment
Open

NinjaEbeanDatabaseLifecycle- Shutdown Manager #18

hugogoncalves opened this issue Oct 3, 2022 · 1 comment

Comments

@hugogoncalves
Copy link

hugogoncalves commented Oct 3, 2022

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 to ShutdownManager.touch and my issues disapeared.

@h-arlt
Copy link

h-arlt commented Jun 16, 2023

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants