Brain Docs

Reference

Python SDKInstallationHTTP clientWire clientSync vs async
txn_begintxn_committxn_abort
ErrorsRetriesPagination
Brain/Docs
✦ ASKBrain on GitHubDashboard
Python SDKTransactionstxn_commit

txn_commit

Apply a transaction's writes atomically, and check that every write actually joined it.

PURPOSE

Apply the transaction. Every write that carried the id lands together, or none does.

Handshake credentialstable
txn_commit(request: TxnCommitRequest) -> TxnCommitResponse

Parameters

ParameterTypeRequired
txn_idUUID bytesrequired

The transaction to commit.

Returns

FieldTypePresence
txn_idUUID bytesalways

Echoed back.

committed_at_unix_nanos64-bit integeralways

When it landed.

operations_appliedintegeralways

How many operations were in it. Compare this against what you sent — a mismatch means a write did not carry the id and has already landed outside the transaction.

HTTP has no transactions

The HTTP edge exposes no transaction routes. Each HTTP verb is its own unit. If several writes must land together, you need the wire client — see Wire client.

Failure modes

CodeStatusRetry
TransactionConflict409fatal

Another transaction touched the same rows. Terminal for this transaction; retry the whole unit, not the commit.

TransactionTooLarge413fatal

The transaction exceeded the server's size bound. Split the work.

TransactionTimeout408fatal

The transaction's timeout elapsed before the commit arrived. Its writes did not land.

See also
txn_beginErrors

Was this page helpful?

txn_begin

Open a transaction with an id you generate, and a timeout the server may lower.

txn_abort

Discard a transaction's writes without waiting for its timeout.

On this page

ParametersReturnsFailure modes
Suggest an editOpen in Playground