EPUB | CHM | PDF

TMySQLDatabase.Properties.TransIsolation

Top Previous Next

Specifies the transaction isolation level for transactions.

Syntax:

type TTransIsolation = (tiDirtyRead,
                        tiReadCommitted,
                        tiRepeatableRead);
property TransIsolation: TTransIsolation;

Description:

Use TransIsolation to specify the transaction isolation level for database transactions. Transaction isolation level determines how a transaction interacts with other simultaneous transactions when they work with the same tables, and how much a transaction sees of the work performed by other transactions.

TransIsolation can be any one of the three values summarized in the following table:

Isolation level

Meaning

tiDirtyRead

Permits reading of uncommitted changes made to the database by other simultaneous transactions. Uncommitted changes are not permanent, and might be rolled back (undone) at any time. At this level a transaction is least isolated from the effects of other transactions.

tiReadCommitted

Permits reading of committed (permanent) changes made to the database by other simultaneous transactions. This is the default TransIsolation property value.

tiRepeatableRead

Permits a single, one-time reading of the database. The transaction cannot see any subsequent changes made by other simultaneous transactions. This isolation level guarantees that once a transaction reads a record, its view of that record does not change unless it makes a modification to the record itself. At this level, a transaction is most isolated from other transactions.

note Applications that use passthrough SQL for handling transactions must pass a transaction isolation level directly to the database server using the appropriate SQL statement.