SQL Server · Types · Errors
ArxDatabaseException
Definition
- Namespace
ARX.SDK- Package
ARX.SDK
public sealed class ArxDatabaseException : ArxExceptionThe database reported an error. The native exception is the InnerException.
Constructor
ArxDatabaseException(ArxErrorCode code, string message, Exception innerException)A database error mapped to its ARX code; the driver's exception is the inner exception.
Parameter Type Description codeArxErrorCodeThe ARX error code: its thousands digit is the category. messagestringA message for logs and developers. It names tables, columns and constraints, never values. innerExceptionExceptionThe driver's exception (PostgresException, SqlException, MySqlException, a MongoException or an AmazonDynamoDBException).
Methods
static ArxException InLinkWhenItIs(ArxException mapped, ARX.SDK.Query.ArxQueryExpression query)For the providers' use: an ARX5002 UndefinedAttribute from a query whose missing column only its link entities name, said of the link's table (
EntityName) and alias instead of the query's own table. Any other error is returned as it is.Parameter Type Description mappedArxExceptionThe error the provider's mapper made, with the missing column as its AttributeName.queryARX.SDK.Query.ArxQueryExpressionThe query that was sent.
Usage
A line from a verified sample; the full, runnable code is on its page.
catch (ArxDatabaseException error) when (error.Code == ArxErrorCode.ForeignKeyViolation)Create a record that points at another one, scenario 4
Used in:
- Create a record that points at another oneCreate
- Catch an error by its codeCreate
- Instants, local times, dates and times of dayCreate
- Picklist values checked against the application's catalogCreate
- Turn ARX error codes into messages for the userCreate
- Natural ids, uuid ids and a table with a compound keyCreate
- Several calls in one ARX transaction: commit or roll backCreate
- Write to two databases, each with its own serviceCreate
- Create many records in one call and get their idsCreateMultiple
- Save an account's contacts in one callCreateMultiple
- Import a 20,000-item product feed in one callCreateMultiple
- Import 5,000 contacts in batches, in one transactionCreateMultiple
- Turn update errors into messagesUpdate
- Change prices found by a compound keyUpdate
- Updates in one ARX transaction: commit, roll back, abortUpdate
- A referenced record: ARX3002, then delete in orderDelete
- Replace an order's lines: delete, create, update, all or nothingDelete
- Read your own writes in an ARX transactionRetrieve
- Turn read errors into messagesRetrieveMultiple
- Read in a batch scopeRetrieveMultiple
- Read functions in depth: table rows, one row, scalar values, what functions don't take, proceduresRetrieveMultiple
- Business errors raised by a procedureExecute
- A nightly job that commits in batchesExecute
- Execute in an ARX transactionExecute
- Execute in a batch scope: a refused call undone aloneExecute