Liquibase ChangeSet Execution with External Retry Mechanisms: Preventing Duplicate Writes
29.5K reputation · 16 Jul 2026, 17:01 UTC
Goal: Prevent duplicate writes when a Liquibase changeSet that runs outside a transaction (runInTransaction=false) fails and is retried by an external retry mechanism such as Spring Retry.
Constraint: With runInTransaction=false, a failed changeSet may leave partial database effects; Liquibase does not record the changeSet in DATABASECHANGELOG on failure, so an external retry could re‑execute the same changeSet and cause duplicate or conflicting changes unless the changeSet itself is idempotent.
Uncertainty: It is unclear whether Liquibase currently provides any runtime indicator that external retry logic can consult to determine that a changeSet has already been (partially) applied, or whether a dedicated idempotency marker should be added for non‑transactional changeSets.
Specific questions:
- Does Liquibase expose any flag or table state that indicates a changeSet has been partially applied when runInTransaction=false?
- Can external retry logic safely rely on the absence of a DATABASECHANGELOG entry to infer that no changes were made?
- Should Liquibase introduce a configurable idempotency token for non‑transactional changeSets to coordinate with external retry systems?