MySQL · Types · Services and connections

ArxMySqlConnection

Definition

Namespace
ARX.SDK.MySQL.Services
Package
ARX.SDK.MySQL
C#
public sealed class ArxMySqlConnection : ArxConnection

A MySQL connection for ARX transactions. Application code begins a transaction on it and passes the transaction to ArxMySqlDbService calls; it never needs a MySqlConnector type.

Constructor

  • ArxMySqlConnection(string connectionString)

    A connection for ARX transactions. It opens with the first BeginTransactionAsync.

    Parameter Type Description
    connectionStringstringThe MySqlConnector connection string.

Usage

C#

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

await using (var connection = new ArxMySqlConnection(dbContext.ConnectionString))

Several calls in one ARX transaction: commit or roll back, scenario 1

Used in:

Notes

It wraps a MySqlConnection, which is sealed, so ARX can't derive from it. The connection opens on the first BeginTransactionAsync, with the session defaults of every connection ARX opens (the session time zone UTC and a strict SQL mode, stated once when it opens), and closes on dispose. Its transactions have the server's default isolation level (REPEATABLE READ unless the server says otherwise). One transaction at a time, and one call at a time. Not thread-safe.