Skip to content

start_transaction async

start_transaction(
    *,
    config_overrides: Optional[AsyncLakeFormationClientConfig] = None,
    transaction_type: Optional[TransactionType] = None,
) -> StartTransactionResponse

Starts a new transaction and returns its transaction ID. Transaction IDs are opaque objects that you can use to identify a transaction.

Parameters:

  • transaction_type (Optional[TransactionType], default: None ) –

    Indicates whether this transaction should be read only or read and write. Writes made using a read-only transaction ID will be rejected. Read-only transactions do not need to be committed.

Raises:

Source code in docs_src/capo_lakeformation/_services/async_lake_formation.py
async def start_transaction(
    self,
    *,
    config_overrides: Optional[AsyncLakeFormationClientConfig] = None,
    transaction_type: Optional[
        "capo_lakeformation.types.transaction_type.TransactionType"
    ] = None,
) -> "capo_lakeformation.types.start_transaction_response.StartTransactionResponse":
    """<p>Starts a new transaction and returns its transaction ID. Transaction IDs are opaque objects that you can use to identify a transaction.</p>

    Args:
        transaction_type: <p>Indicates whether this transaction should be read only or read and write. Writes made using a read-only transaction ID will be rejected. Read-only transactions do not need to be committed. </p>

    Raises:
        capo_lakeformation.errors.internal_service_exception.InternalServiceException: <p>An internal service error occurred.</p>
        capo_lakeformation.errors.operation_timeout_exception.OperationTimeoutException: <p>The operation timed out.</p>
        capo_lakeformation.errors.UnknownServiceError: The service returned an error code this client does not model.
    """

    async def _handler(
        req: "AsyncOperationRequest[capo_lakeformation.types.start_transaction_request.StartTransactionRequest]",
    ) -> AsyncOperationResponse[
        "capo_lakeformation.types.start_transaction_response.StartTransactionResponse"
    ]:
        import capo_lakeformation._operations.aws_lake_formation.start_transaction

        (
            output,
            http_response,
        ) = await capo_lakeformation._operations.aws_lake_formation.start_transaction.async_start_transaction(
            req.options, req.input
        )
        return AsyncOperationResponse(output=output, response=http_response)

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("StartTransaction")
    )
    input_: capo_lakeformation.types.start_transaction_request.StartTransactionRequest = {}
    if transaction_type is not None:
        input_["transaction_type"] = transaction_type

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