Solid arrows: calls. Dashed: replies. Red: errors. Amber: conflicts. Dashed blue boxes: database transactions (each IdempotencyReserver method opens its own); amber boxes: alternative branches.
What to look for
reserve runs in its own transaction (REQUIRES_NEW), so the PROCESSING row is committed before the 2-second call to the provider.saveAndFlush forces the INSERT right away; the UNIQUE constraint on idem_key is checked at that moment.- The stored
response_body is what later retries get back.