Skip to content

start_transaction

start_transaction(
    *,
    config_overrides: Optional[LakeFormationClientConfig] = 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/lake_formation.py
def start_transaction(
    self,
    *,
    config_overrides: Optional[LakeFormationClientConfig] = 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.
    """

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

        output, http_response = (
            capo_lakeformation._operations.aws_lake_formation.start_transaction.start_transaction(
                req.options, req.input
            )
        )
        return OperationResponse(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 = execute_pipeline(
        OperationRequest(input=input_, options=options_),
        handler=_handler,
        interceptors=list(interceptors_),
    )
    response.response.close()
    return response.output