Skip to content

Method transact_rollback

marufcetin edited this page Sep 1, 2026 · 1 revision

Method: transact_rollback()

Turkce Dokumantasyon | English Documentation

Category: Transaction & Concurrency Methods
Submodule: AmberDB::Transact
Entry Type: Transaction Rollback


1. Definition and Overview

transact_rollback() forces an immediate manual rollback of the active transaction. It reads the active .txn journal file and reverts all inserted, modified, or deleted records in LIFO reverse order, restoring all tables and secondary indexes to their exact pre-transaction state.


2. Syntax and Signature

$adb->transact_rollback();

3. Practical Code Example

$adb->transact_start();
eval {
    # Risky sequence
    $adb->modify_id("accounts", @acc1);
    die "Validation failure\n" if $invalid_condition;
    $adb->modify_id("accounts", @acc2);
    $adb->transact_end();
};
if ($@) {
    $adb->transact_rollback();
}

4. See Also

AmberDB Encyclopedia

Home · A-Z Index


Getting Started & Guides


Core Concepts


Core CRUD Methods


Query, Search & Facets


Transactions & Locks


Cache, Buffer & Low-Level


Locale & Helpers


Maintenance & Tools


Configuration Flags


File Formats


Language

Clone this wiki locally