beginTransaction method

Future<BeginTransactionResponse> beginTransaction({
  1. required String resourceArn,
  2. required String secretArn,
  3. String? database,
  4. String? schema,
})

Starts a SQL transaction.

A transaction times out if no calls use its transaction ID in three minutes. If a transaction times out before it's committed, it's rolled back automatically.

For Aurora MySQL, DDL statements inside a transaction cause an implicit commit. We recommend that you run each MySQL DDL statement in a separate ExecuteStatement call with continueAfterTimeout enabled.

May throw AccessDeniedException. May throw BadRequestException. May throw DatabaseErrorException. May throw DatabaseNotFoundException. May throw DatabaseResumingException. May throw DatabaseUnavailableException. May throw ForbiddenException. May throw HttpEndpointNotEnabledException. May throw InternalServerErrorException. May throw InvalidResourceStateException. May throw InvalidSecretException. May throw SecretsErrorException. May throw ServiceUnavailableError. May throw StatementTimeoutException. May throw TransactionNotFoundException.

Parameter resourceArn : The Amazon Resource Name (ARN) of the Aurora Serverless DB cluster.

Parameter secretArn : The name or ARN of the secret that enables access to the DB cluster.

Parameter database : The name of the database.

Parameter schema : The name of the database schema.

Implementation

Future<BeginTransactionResponse> beginTransaction({
  required String resourceArn,
  required String secretArn,
  String? database,
  String? schema,
}) async {
  final $payload = <String, dynamic>{
    'resourceArn': resourceArn,
    'secretArn': secretArn,
    if (database != null) 'database': database,
    if (schema != null) 'schema': schema,
  };
  final response = await _protocol.send(
    payload: $payload,
    method: 'POST',
    requestUri: '/BeginTransaction',
    exceptionFnMap: _exceptionFns,
  );
  return BeginTransactionResponse.fromJson(response);
}