end storage transaction

This block is part of the storage group and was last modified in core v15.0.1.

end storage transaction v15.0.1

Commits the storage transaction opened by start storage transaction and stores its result for a later retry of the same id.

In pins 2 + flow
  • flow
    flow
  • transaction id
    value

    Leave empty to end the transaction open in this flow. A bare id names a transaction this blueprint started; the qualified `bp::` reference from the start block names one started elsewhere : allowed only once that run's lease has lapsed.

  • result
    value

    Stored on the record and returned by a later start of the same id : the response a retried request should get.

Out pins 5 + flow
  • flow
    flow
  • success
    condition
  • transaction id
    value
  • transaction
    object
  • status
    value
  • error
    value

Commits a storage transaction: marks it committed, stores `result` on the record (a later function_transaction_start of the same id answers already_committed with it), releases the opener's lease and keeps the journal for its retention. Without a wired transaction_id it ends the transaction currently open in this flow; after it, writes in this flow are ordinary writes again. Fails with TRANSACTION_NOT_FOUND when there is none, TRANSACTION_NOT_OPEN when it already ended, TRANSACTION_NOT_OWNED when it was opened by another run whose lease is still alive (ownership is the attempt token the start block put in this flow; a wired id carries none). A wired id names a transaction this blueprint started unless it is the qualified `bp:<blueprint>:<id>` reference. `transaction` carries the record (id, status, attempts, op_count, started, ended, result). In simulation nothing is written.

A typical wiring for end storage transaction: a function trigger starts the flow; the flow out pin feeds debug.

Studio canvas example for the end storage transaction block: typical wiring for end storage transaction.

Version history

Introduced in v15.0.1.


Back to storage Return to the main group to view all sub-groups Back to storage Return to the group to view all blocks within this group