Skip to main content

startTransaction()

Last updated 10/05/2023

Example

This code is starting a transaction using the startTranscation() function on the Five object and assigning the result to the variable tx. The isOk() function is called to check if the transaction was successful. If the transaction is not successful an error is returned using the createError() on the Five object.

JavaScript
Start transaction on the database
    const tx = five.startTransaction(db);
if (tx.isOk() === false) {
return five.createError(tx);
}