Brain Docs

Reference

TypeScript SDKInstallationHTTP clientWire client
txnBegintxnCommittxnAbort
ErrorsRetriesPagination
Brain/Docs
✦ ASKBrain on GitHubDashboard
TypeScript SDKTransactionstxnCommit

txnCommit

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
txnCommit(request: TxnCommitRequest): Promise<TxnCommitResponse>

Parameters

ParameterTypeRequired
txnIdUUID bytesrequired

The transaction to commit.

Returns

FieldTypePresence
txnIdUUID bytesalways

Echoed back.

committedAtUnixNanos64-bit integeralways

When it landed.

operationsAppliedintegeralways

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
txnBeginErrors

Was this page helpful?

txnBegin

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

txnAbort

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

On this page

ParametersReturnsFailure modes
Suggest an editOpen in Playground