---
id: ADR-CRM-DQ-005
title: Apply a merge in one transaction
product_area: crm
module: data-quality
revision: 1
status: proposed
design_intent: confirmed
source_sha:
  services-crm: a8d1364f1dd44b723bb5f9acba12f983e9ec8d69
decision: >-
  CRM applies the planned merge and calls application participants within one
  transaction; failures roll it back before a separate transaction records the
  failed attempt and reopens eligible plans.
constrains:
  - WF-CRM-DQ-006
  - STATE-CRM-DQ-005
  - STATE-CRM-DQ-004
  - DOM-CRM-DQ-004
  - SVC-CRM-DQ-merges
origin: >-
  services-crm:docs/merging/decisions.md#D1 (Andrew, 2026-10-11);
  docs/merging/architecture.md#5.1 One transaction
alternatives:
  - option: Update application references after CRM commits
    why_not: A failed subscriber could leave references attached to absorbed records.
  - option: Commit stages and compensate
    why_not: >-
      The chosen design requires atomicity rather than a sequence of reversal
      operations.
consequences:
  - Mistakes require manual repair because merging has no reverse operation.
  - Other edits can wait on the rows a merge holds.
  - >-
    Rollback restores the merge row to queued until failure settlement commits;
    job progress may still show running.
supersedes: []
evidence:
  - >-
    services-crm at a8d1364f: modules/merges/services/merges/merge-execution.ts,
    merge-settlement.ts; docs/merging/decisions.md D1.
---

# Apply a merge in one transaction

## Context

A failed participant must not leave some records combined and others unchanged.

## Decision

CRM applies the planned merge and calls application participants within one transaction; failures roll it back before a separate transaction records the failed attempt and reopens eligible plans.

## Alternatives Considered

Update application references after CRM commits. A failed subscriber could leave references attached to absorbed records.

Commit stages and compensate. The chosen design requires atomicity rather than a sequence of reversal operations.

## Consequences

Mistakes require manual repair because merging has no reverse operation. Other edits can wait on the rows a merge holds. Rollback restores the merge row to queued until failure settlement commits; job progress may still show running.
