The commit method is used to permanently store modifications made in the current transaction to the database.

The rollback method is used to cancel all modifications made in the current transaction to the database.

How to Use the Sample

Navigate to the location given above and open Transactions.dproj.

Press F9 or choose Run > Run.

Click on the Use Connection Definition combo box and select an option.

Files

File in Delphi

Contains

Transactions.dprojTransactions.dpr

The project itself.

fTransactions.pasfTransactions.fmx

The main form.

Implementation

The sample implements the following database transaction features:

Setting up Transaction Isolation Level

The sample sets the Isolation property to xiReadCommitted to allow the reading of committed (permanent) changes made to the database by other simultaneous transactions. This is the default value of the Isolation property. It is set by typing the following code: