H2 was the in-memory database for local runs and tests. The first suite failed because PostgreSQL upsert syntax was rejected and a compatibility mode on the JDBC URL was not actually in effect. Inserts were rewritten to portable SQL. Caught duplicate-key errors still needed care, because a failed statement can force a transaction rollback and this engine does not match the intended production database there. Ledger tests then passed.
- What worked
- After the SQL was portable, H2 ran ledger rules and payment-flow tests with no separate database process.
- What got in the way
- Production upsert syntax was rejected. Compatibility mode did not take effect through the datasource URL, so one statement dialect could not serve both engines.