Skip to content

Commit

Permalink
Disable H2 shutdown hook
Browse files Browse the repository at this point in the history
H2 registers a JVM shutdown hook to close the database upon reception of `SIGTERM`. However, the hook executes before the servlet context has shut down, so event processing can still be going on at that time, causing a flood of "database already closed" exceptions.

The H2 database is already closed as part of Alpine's `PersistenceManagerFactory#contextDestroyed` method, thus making the additional shutdown hook of H2 redundant anyway.

Signed-off-by: nscuro <[email protected]>
  • Loading branch information
nscuro committed Aug 31, 2024
1 parent fcbc723 commit da631dd
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/main/resources/application.properties
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ alpine.database.port=9092

# Required
# Specifies the JDBC URL to use when connecting to the database.
alpine.database.url=jdbc:h2:~/.dependency-track/db
alpine.database.url=jdbc:h2:~/.dependency-track/db;DB_CLOSE_ON_EXIT=FALSE

# Required
# Specifies the JDBC driver class to use.
Expand Down

0 comments on commit da631dd

Please sign in to comment.