Skip to content

commit_transaction async

commit_transaction(
    resource_arn: Arn,
    secret_arn: Arn,
    transaction_id: Id,
    *,
    config_overrides: Optional[AsyncRDSDataClientConfig] = None,
) -> CommitTransactionResponse

Ends a SQL transaction started with the BeginTransaction operation and commits the changes.

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.

  • transaction_id (Id) –

    The identifier of the transaction to end and commit.

Raises:

Source code in docs_src/capo_rds_data/_services/async_rds_data.py
async def commit_transaction(
    self,
    resource_arn: "capo_rds_data.types.arn.Arn",
    secret_arn: "capo_rds_data.types.arn.Arn",
    transaction_id: "capo_rds_data.types.id.Id",
    *,
    config_overrides: Optional[AsyncRDSDataClientConfig] = None,
) -> "capo_rds_data.types.commit_transaction_response.CommitTransactionResponse":
    """<p>Ends a SQL transaction started with the <code>BeginTransaction</code> operation and commits the changes.</p>

    Args:
        resource_arn: <p>The Amazon Resource Name (ARN) of the Aurora Serverless DB cluster.</p>
        secret_arn: <p>The name or ARN of the secret that enables access to the DB cluster.</p>
        transaction_id: <p>The identifier of the transaction to end and commit.</p>

    Raises:
        capo_rds_data.errors.access_denied_exception.AccessDeniedException: <p>You don't have sufficient access to perform this action.</p>
        capo_rds_data.errors.bad_request_exception.BadRequestException: <p>There is an error in the call or in a SQL statement. This exception is deprecated.</p>
        capo_rds_data.errors.database_error_exception.DatabaseErrorException: <p>There was an error in processing the SQL statement.</p>
        capo_rds_data.errors.database_not_found_exception.DatabaseNotFoundException: <p>The DB cluster doesn't have a DB instance.</p>
        capo_rds_data.errors.database_unavailable_exception.DatabaseUnavailableException: <p>The writer instance in the DB cluster isn't available.</p>
        capo_rds_data.errors.forbidden_exception.ForbiddenException: <p>There are insufficient privileges to make the call.</p>
        capo_rds_data.errors.http_endpoint_not_enabled_exception.HttpEndpointNotEnabledException: <p>The HTTP endpoint for using RDS Data API isn't enabled for the DB cluster.</p>
        capo_rds_data.errors.internal_server_error_exception.InternalServerErrorException: <p>An internal error occurred.</p>
        capo_rds_data.errors.invalid_resource_state_exception.InvalidResourceStateException: <p>The resource is in an invalid state.</p>
        capo_rds_data.errors.invalid_secret_exception.InvalidSecretException: <p>The Secrets Manager secret used with the request isn't valid.</p>
        capo_rds_data.errors.not_found_exception.NotFoundException: <p>The <code>resourceArn</code>, <code>secretArn</code>, or <code>transactionId</code> value can't be found.</p>
        capo_rds_data.errors.secrets_error_exception.SecretsErrorException: <p>There was a problem with the Secrets Manager secret used with the request, caused by one of the following conditions:</p> <ul> <li> <p>RDS Data API timed out retrieving the secret.</p> </li> <li> <p>The secret provided wasn't found.</p> </li> <li> <p>The secret couldn't be decrypted.</p> </li> </ul>
        capo_rds_data.errors.service_unavailable_error.ServiceUnavailableError: <p>The service specified by the <code>resourceArn</code> parameter isn't available.</p>
        capo_rds_data.errors.statement_timeout_exception.StatementTimeoutException: <p>The execution of the SQL statement timed out.</p>
        capo_rds_data.errors.transaction_not_found_exception.TransactionNotFoundException: <p>The transaction ID wasn't found.</p>
        capo_rds_data.errors.UnknownServiceError: The service returned an error code this client does not model.
    """

    async def _handler(
        req: "AsyncOperationRequest[capo_rds_data.types.commit_transaction_request.CommitTransactionRequest]",
    ) -> AsyncOperationResponse[
        "capo_rds_data.types.commit_transaction_response.CommitTransactionResponse"
    ]:
        import capo_rds_data._operations.rds_data_service.commit_transaction

        (
            output,
            http_response,
        ) = await capo_rds_data._operations.rds_data_service.commit_transaction.async_commit_transaction(
            req.options, req.input
        )
        return AsyncOperationResponse(output=output, response=http_response)

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("CommitTransaction")
    )
    input_: capo_rds_data.types.commit_transaction_request.CommitTransactionRequest = {
        "resource_arn": resource_arn,
        "secret_arn": secret_arn,
        "transaction_id": transaction_id,
    }

    response = await aexecute_pipeline(
        AsyncOperationRequest(input=input_, options=options_),
        handler=_handler,
        interceptors=list(interceptors_),
    )
    await response.response.aclose()
    return response.output