# `AshPostgres.Temporal.WriteConflict`
[🔗](https://github.com/ash-project/ash_postgres/blob/v2.15.1/lib/temporal/write_conflict.ex#L5)

Used when a temporal write keeps losing to concurrent writes to the same records.

A temporal write that finds the versions it's splitting were changed by another
transaction in the meantime runs again. This is raised when it has run `attempts` times
and still conflicted, which takes many transactions writing the same slice of the same
records at once. Retrying the action is safe: nothing was written.

# `exception`

```elixir
@spec exception(opts :: Keyword.t()) :: %AshPostgres.Temporal.WriteConflict{
  __exception__: term(),
  attempts: term(),
  bread_crumbs: term(),
  class: term(),
  path: term(),
  resource: term(),
  splode: term(),
  stacktrace: term(),
  vars: term()
}
```

Create an `Elixir.AshPostgres.Temporal.WriteConflict` without raising it.

## Keys

- :resource
- :attempts

---

*Consult [api-reference.md](api-reference.md) for complete listing*
