Skip to content

Update H2 database configuration for H2 2.x compatibility#41

Open
devin-ai-integration[bot] wants to merge 1 commit intomasterfrom
devin/1776966590-update-h2-database-config
Open

Update H2 database configuration for H2 2.x compatibility#41
devin-ai-integration[bot] wants to merge 1 commit intomasterfrom
devin/1776966590-update-h2-database-config

Conversation

@devin-ai-integration
Copy link
Copy Markdown

Summary

Updates the H2 database dependency and configuration to prepare for H2 2.x (as used by Dropwizard 4.x). Three changes:

  1. example.yml: Appended ;AUTO_SERVER=TRUE to the JDBC URL. H2 2.x requires explicit options for file-based databases — AUTO_SERVER=TRUE enables automatic mixed-mode so the database file can be shared across processes.
  2. pom.xml: Pinned H2 to version 2.2.224 (previously inherited 1.4.192 from the Dropwizard 1.0.5 BOM).
  3. pom.xml: Bumped maven-compiler-plugin source/target from 1.6 to 11, since H2 2.x requires Java 11+.

What was reviewed and left unchanged:

  • src/main/resources/migrations.xml — uses Liquibase createTable with bigint autoIncrement, which is compatible with H2 2.x.
  • Java source files — no native SQL queries found; all DB access goes through Hibernate/Liquibase.

Review & Testing Checklist for Human

  • Verify Hibernate dialect compatibility: The Dropwizard BOM is still 1.0.5, meaning Hibernate and other libraries are from that era. Confirm the old Hibernate version works correctly with H2 2.2.224 at runtime (not just compile time). You may need to set hibernate.dialect to org.hibernate.dialect.H2Dialect explicitly if H2 auto-detection fails.
  • Run the app end-to-end: Start the server with java -jar target/DropwizardEmployee-1.0.5.jar server example.yml after running db migrate, and verify CRUD operations against the H2 database work. Compile success alone does not guarantee runtime compatibility.
  • Confirm AUTO_SERVER=TRUE vs MODE=LEGACY: AUTO_SERVER=TRUE was chosen for multi-process file access. If you encounter SQL syntax errors at runtime (e.g., from Hibernate-generated DDL), you may need MODE=LEGACY instead or in addition.
  • Java 11 runtime: Ensure the deployment environment runs Java 11+. The compiler target was bumped from 1.6 → 11, so the output bytecode will no longer run on older JVMs.

Notes

  • The H2 version override (2.2.224) will be redundant once the Dropwizard BOM is upgraded to 4.x, at which point it can be removed so the BOM manages the version again.
  • migrations.xml was reviewed for H2 2.x SQL compatibility issues (identity columns, deprecated functions) — none found.

Link to Devin session: https://app.devin.ai/sessions/a480bcf7137f4e3eb7abb54845913bfa
Requested by: @WesternConcrete

- Update JDBC URL in example.yml to include AUTO_SERVER=TRUE for H2 2.x
- Add explicit H2 2.2.224 version in pom.xml (H2 2.x required by Dropwizard 4.x)
- Update maven-compiler-plugin source/target from 1.6 to 11 (H2 2.x requires Java 11+)
- Reviewed migrations.xml: Liquibase createTable with bigint autoIncrement is already H2 2.x compatible
- No native SQL queries found in Java source code

Co-Authored-By: Wes Convery <2wconvery@gmail.com>
@devin-ai-integration
Copy link
Copy Markdown
Author

🤖 Devin AI Engineer

I'll be helping with this pull request! Here's what you should know:

✅ I will automatically:

  • Address comments on this PR. Add '(aside)' to your comment to have me ignore it.
  • Look at CI failures and help fix them

Note: I can only respond to comments from users who have write access to this repository.

⚙️ Control Options:

  • Disable automatic comment and CI monitoring

Copy link
Copy Markdown
Author

@devin-ai-integration devin-ai-integration Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

✅ Devin Review: No Issues Found

Devin Review analyzed this PR and found no potential bugs to report.

View in Devin Review to see 2 additional findings.

Open in Devin Review

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

Successfully merging this pull request may close these issues.

1 participant