KiokuDB::Backend::Role::TXN(3pm)

KiokuDB::Backend::Role::TXN3pm

Backend level transaction support.

Usage

    package MyBackend;
    use Moose;
    with qw(
        KiokuDB::Backend
        KiokuDB::Backend::Role::TXN
    );
    sub txn_begin { ... }
    sub txn_commit { ... }
    sub txn_rollback { ... }

Version

version 0.57

Overview

This API is inspired by standard database transactions much like you get with DBI.

This is the low level interface required by "txn_do" in KiokuDB.

Optional methods

txn_do $code, %callbacks

This method should evaluate the code reference in the context of a transaction, inside an "eval". If any errors are caught the transaction should be aborted, otherwise it should be committed. This is much like "txn_do" in DBIx::Class::Schema.

The "rollback" callback should be fired when the transaction will be aborted.

Required methods

txn_begin [ $parent_txn ]

Begin a new transaction.

This method can return a transaction handle that will later be passed to "txn_commit" or "txn_rollback" as necessary.

The current handle will be passed to nested calls to "txn_begin".

txn_commit $txn

Commit the transaction.

txn_rollback $txn

Rollback the transaction.

Releases

6 releases since Debian 7 (Wheezy); the text changed 2 times.

  1. 7
  2. 8–10
  3. 12–13

Author

Yuval Kogman <[email protected]>

From libkiokudb-perl 0.57-3 in Debian 13 (Trixie). Parsed by carta from the page's man source.