---
title: Audit note concurrency check
summary: Verify that an audit note can be saved without an optimistic-concurrency conflict.
status: draft
owner: SAIF.Core documentation team
last_reviewed: 2026-09-24
library: SAIF.Data
reference_type: package
operation_id: OP-SD-11
trigger: Caller attempts to save an audit note.
---

# Audit note concurrency check

Verify that an audit note can be saved without an optimistic-concurrency conflict.

| Field | Value |
| --- | --- |
| **Operation ID** | OP-SD-11 |
| **Trigger** | Caller attempts to save an audit note. |
| **Inputs** | Note id, update number |
| **Outputs** | bool |
| **Primary components** | `AuditNoteQueryProvider.IsAuditNoteNoContention` |
| **Entry point** | `Data/SAIF.Data/Queries/Claims/AuditNoteQueryProvider.cs` |

## Steps

1. If `noteId == 0`, return true (new note). Otherwise return true only when a note with the same `Id` and `UpdateNumber` exists ([SD-BR-033](../business-rules.md#sd-br-033-audit-note-save-allowed-only-under-optimistic-concurrency-match), [SQL-004](../sql/SQL-004-audit-note-query-provider-get-audit-note.md), [SQL-005](../sql/SQL-005-audit-note-query-provider-get-audit-notes-for-claim.md), [SQL-006](../sql/SQL-006-audit-note-query-provider-get-audit-notes-for-bill.md), [SQL-007](../sql/SQL-007-audit-note-query-provider-get-all-audit-notes.md), [SQL-008](../sql/SQL-008-audit-note-query-provider-get-note-type-code.md), [SQL-009](../sql/SQL-009-audit-note-query-provider-get-note-categories.md), [SQL-010](../sql/SQL-010-audit-note-query-provider-get-note-types.md), [SQL-011](../sql/SQL-011-audit-note-query-provider-get-note-types-for-category.md), [SQL-012](../sql/SQL-012-audit-note-query-provider-is-audit-note-no-contention.md)). Data: `CbpNote` (`CBP_NOTE`).

## Process flow

The following diagram visualizes this operation's control flow.

```mermaid
flowchart TD
	Start([Caller attempts to save an audit note.]) --> S1["`AuditNoteQueryProvider.IsAuditNoteNoContention`"]
	S1 --> S2{"Rules satisfied?"}
	S2 -->|Yes| EndOk([Result returned])
	S2 -->|No| EndErr([Exception / empty result])
```

## Failure and edge-case behavior
- Stale `UpdateNumber`: returns false, signaling a concurrency conflict to the caller.

## Related documentation
- [Operations and processes](../operations-processes.md)
- [Business rules](../business-rules.md)
- [SQL catalog](../sql/index.md)
- [Database tables](../database-tables.md)


## Sources
- `Data/SAIF.Data/Queries/Claims/AuditNoteQueryProvider.cs`
- `Data/SAIF.Data/Queries/Claims/AuditNoteQueryProvider.cs:19`
- `Data/SAIF.Data/Queries/Claims/AuditNoteQueryProvider.cs:25`
- `Data/SAIF.Data/Queries/Claims/AuditNoteQueryProvider.cs:32`
