RAD Studio VCL Reference
ContentsIndex
PreviousUpNext
TDatabase.TransIsolation Property

Specifies the transaction isolation level for transactions managed by the Borland Database Engine (BDE).

Pascal
property TransIsolation: TTransIsolation;
C++
__property TTransIsolation TransIsolation;

Use TransIsolation to specify the transaction isolation level for database transactions managed by the BDE. 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.

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.
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.  

Different database servers support different levels of transaction isolation. If an application sets TransIsolation to an unsupported level for a remote SQL server, the BDE uses the next highest level supported by that server. The following table summarizes the isolation levels supported by the servers recognized by the BDE: 

ServerSpecified LevelActual Level

Server 
Specified Level 
Actual Level 
Oracle  
tiDirtyRead | tiReadCommitted | tiRepeatableRead  
tiReadCommitted | tiReadCommitted | tiRepeatableRead (READONLY)  
Sybase, MS-SQL  
tiDirtyRead | tiReadCommitted | tiRepeatableRead  
tiReadCommitted | tiReadCommitted | Not supported  
DB2  
tiDirtyRead | tiReadCommitted | tiRepeatableRead  
tiDirtyRead | tiReadCommitted | tiRepeatableRead  
Informix  
tiDirtyRead | tiReadCommitted | tiRepeatableRead  
tiDirtyRead | tiReadCommitted | tiRepeatableRead  
InterBase  
tiDirtyRead | tiReadCommitted | tiRepeatableRead  
tiReadCommitted | tiReadCommitted | tiRepeatableRead  
Paradox, dBASE, Access, FoxPro  
tiDirtyRead | tiReadCommitted | tiRepeatableRead  
tiDirtyRead | Not supported | Not supported  

Note: For local transactions against Paradox and dBASE, TransIsolation must be set to tiDirtyRead. Otherwise, an exception is raised.
If an application uses ODBC to interface with a server, the ODBC driver must also support the isolation level. For more information about supported isolation levels, see the documentation for the ODBC driver in question. 

 

Copyright(C) 2009 Embarcadero Technologies, Inc. All Rights Reserved.
What do you think about this topic? Send feedback!