begin_transaction
¶
begin_transaction(
resource_arn: Arn,
secret_arn: Arn,
*,
config_overrides: Optional[RDSDataClientConfig] = None,
database: Optional[DbName] = None,
schema: Optional[DbName] = None,
) -> BeginTransactionResponse
Starts a SQL transaction.
A transaction can run for a maximum of 24 hours. A transaction is terminated and rolled back automatically after 24 hours.
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.
Parameters:
-
resource_arn(Arn) –The Amazon Resource Name (ARN) of the Aurora Serverless DB cluster.
-
secret_arn(Arn) –The name or ARN of the secret that enables access to the DB cluster.
-
database(Optional[DbName], default:None) –The name of the database.
-
schema(Optional[DbName], default:None) –The name of the database schema.
Raises:
-
AccessDeniedException–You don't have sufficient access to perform this action.
-
BadRequestException–There is an error in the call or in a SQL statement. This exception is deprecated.
-
DatabaseErrorException–There was an error in processing the SQL statement.
-
DatabaseNotFoundException–The DB cluster doesn't have a DB instance.
-
DatabaseResumingException–A request was cancelled because the Aurora Serverless DB instance was paused. The Data API request automatically resumes the DB instance. Wait a few seconds and try again.
-
DatabaseUnavailableException–The writer instance in the DB cluster isn't available.
-
ForbiddenException–There are insufficient privileges to make the call.
-
HttpEndpointNotEnabledException–The HTTP endpoint for using RDS Data API isn't enabled for the DB cluster.
-
InternalServerErrorException–An internal error occurred.
-
InvalidResourceStateException–The resource is in an invalid state.
-
InvalidSecretException–The Secrets Manager secret used with the request isn't valid.
-
SecretsErrorException–There was a problem with the Secrets Manager secret used with the request, caused by one of the following conditions:
-
RDS Data API timed out retrieving the secret.
-
The secret provided wasn't found.
-
The secret couldn't be decrypted.
-
-
ServiceUnavailableError–The service specified by the
resourceArnparameter isn't available. -
StatementTimeoutException–The execution of the SQL statement timed out.
-
TransactionNotFoundException–The transaction ID wasn't found.
-
UnknownServiceError–The service returned an error code this client does not model.