Transactions

Overview

A database transaction is a series of operations executed on a database, treated as a cohesive unit of work. This means that all operations within a transaction are either fully completed or not executed at all. In essence, there's no scenario where only part of the operations are carried out, ensuring data integrity. While a transaction is underway, the database may temporarily hold an inconsistent state, but upon completion or commitment, all changes are applied uniformly.

Start transaction programmatically

You can start a transaction programmatically by using Database Manager startTransaction method.

Commit a transaction programmatically

You can commit a transaction programmatically by using Database Manager commitTransaction method.

Rollback a transaction programmatically

You can rollback a transaction programmatically by using Database Manager rollbackTransaction method.

Viewing Transactions

The admin page will show any open transactions. If anything at all shows up here, it is likely a problem as transactions should be only very briefly held open. Long running transactions can cause database issues, like deadlocks.

Manually committing transactions

Here you can manually commit any transactions that are held, by clicking the green check button corresponding to each Transaction ID. This can be used to avoid database issues.

Manually rollback transactions

Here you can manually rollback any transactions that are held, by clicking the X button corresponding to each Transaction ID.

DO NOT COMMIT OR ROLLBACK transactions here unless absolutely necessary. USING COMMIT CAN CAUSE DATA INCONSISTENCY, USE IT FOR TESTING PURPOSES ONLY! Using rollback is NOT necessary when the client crashes, as this will be done automatically. In general, there should NEVER BE ANY REASON AT ALL to commit or rollback client transactions here!

Last updated