atatus_begin_transaction() function is used to start a new transaction. Before using this function, you will have to manually end the current transaction using the atatus_end_transaction().

Compatibility

Compatible with all PHP agent versions.

Syntax

copy
icon/buttons/copy
atatus_begin_transaction()

Parameter

atatus_begin_transaction() does not accept any parameters.

Example

In the following example, we begin a new transaction by ending the current one. However, you will have to set a custom transaction name using the atatus_set_transaction_name("string") function.

copy
icon/buttons/copy
<?php

function example() {

    if (extension_loaded('atatus')) { // ensure PHP agent is available
        atatus_end_transaction(); // stops the current transaction
        atatus_begin_transaction(); //begins a new transaction
        atatus_set_transaction_name("custom_name");
    }
    // ...
}

See also