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

Connection pooling and automate Flway migration #52

Merged
merged 2 commits into from
Aug 20, 2019
Merged

Conversation

steven-sheehy
Copy link
Member

@steven-sheehy steven-sheehy commented Aug 19, 2019

  • Add HikariCP database connection pooling
  • Going forward, please do not keep Connection objects open after use or store them in class variables. Use them locally in try-with-resource so they close automatically after every related batch of statements. Connection pooling doesn't actually close under the covers, just puts it back in the pool.
  • Moves Flyway based DB migrations to code. First process up will lock table and run migration.
  • Adds apiUsername, apiPassword and dbName to config.json to support Flyway placeholders in SQL migration scripts.
  • Adds restart: unless-stopped to containers so they restart after a crash
  • Increases PostgreSQL stop grace period from 10s to 2m so it has more time to shutdown gracefully

Fixes #32

@steven-sheehy steven-sheehy self-assigned this Aug 19, 2019
@steven-sheehy steven-sheehy added enhancement Type: New feature bug Type: Something isn't working and removed enhancement Type: New feature labels Aug 19, 2019
@gregscullard
Copy link
Contributor

Updated config.json.sample to add the parameters that ConfigLoader looks for if environment variables aren't set.

@gregscullard gregscullard merged commit 34c7914 into master Aug 20, 2019
@steven-sheehy steven-sheehy deleted the auto-flyway branch August 22, 2019 03:43
@steven-sheehy steven-sheehy added this to the 0.1.0 milestone Aug 27, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Type: Something isn't working P1
Projects
None yet
Development

Successfully merging this pull request may close these issues.

java.sql.Connection doesn't handle connect closed exception
2 participants