MySQL · Types · Services and connections

ArxBatchOptions

Definition

Namespace
ARX.SDK.Services
Package
ARX.SDK
C#
public sealed class ArxBatchOptions

Options for a batch scope.

Properties

  • bool? Savepoints { get; init; }

    When true, each call made through the scope runs inside its own savepoint. A failed call is then undone alone: the calls before it stay in the transaction, the scope stays Active, and the developer decides whether to continue, retry or roll back. When false or null (the default), any failed call rolls back the whole scope, on every provider, so the same code ends the same way on every database: a body that catches the error has nothing saved, and RunBatchAsync throws ARX1015 when it returns. Ask for savepoints where a failed call should be undone alone; only PostgreSQL, SQL Server and MySQL have them (Savepoints), and true on MongoDB or DynamoDB is refused with ArxNotSupportedException.

Usage

C#

A line from a verified sample; the full, runnable code is on its page.

await using (var scope = await dbContext.Service.BeginBatchAsync(new ArxBatchOptions { Savepoints = true }))

Import 5,000 contacts in batches, in one transaction, scenario 2

Used in: