Skip to content

Use Database Initialization Event Listener #12378

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

Closed
3 tasks
jdpgrailsdev opened this issue Apr 26, 2022 · 0 comments
Closed
3 tasks

Use Database Initialization Event Listener #12378

jdpgrailsdev opened this issue Apr 26, 2022 · 0 comments

Comments

@jdpgrailsdev
Copy link
Contributor

Tell us about the problem you're trying to solve

The existing code couples database access with connection initialization. The system wants to gate service startup on database creation and migration. Separating these two concerns will make it easier to adapt the code to an application framework.

Describe the solution you’d like

Utilize the separate database initialization framework created by #12377. This will include replacing calls in the code base to the getAndInitialize() method of the DatabaseInstance /subclasses to simply just return a configured database object instead of also doing the initialization. In addition, each service should create and call the listeners manually on startup before any attempts to access the database is performed. This logic will eventually be automatically called by the application framework.

Acceptance Criteria

  • Calls to getAndInitialize() replaced/refactored to return a database object only (do not perform initialization)
  • Database initialization occurs as expected for services on startup via manual execution of listeners
  • Existing initialize logic removed from DatabaseInstance /subclasses
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants