Sets the transaction isolation level for the current connection to one of the isolation level modes specified by ODBC.
Syntax:
>>--EXEC SQL--SET TRANSACTION ISOLATION------------------->
>-------.-READ UNCOMMITTED-.---------END-EXEC------------><
+-READ COMMITTED---+
+-REPEATABLE READ--+
+-SERIALIZABLE-----+
Example:
EXEC SQL SET TRANSACTION ISOLATION READ UNCOMMITTED END-EXEC
Comments:
Transactions can affect each other in the following ways, depending on the setting of the transaction isolation level:
These situations can be controlled by locking, which means that a transaction might have to wait until another transaction completes, which limits concurrency (sometimes called pessimistic concurrency), or by forcing a transaction to rollback if the situation occurs, which has less of an impact on concurrency but may force work to be repeated (this is sometimes called optimistic concurrency).
In READ UNCOMMITED mode, dirty reads, nonrepeatable reads and phantoms are all possible.
In READ COMMITED mode, dirty reads are not possible but nonrepeatable reads and phantoms are.
In REPEATABLE READ mode, dirty reads and nonrepeatable reads are not possible, but phantoms are.
In SERIALIZABLE mode dirty reads, nonrepeatable reads and phantoms are all impossible.
Note:
A driver might not support all the isolation levels defined by ODBC. If you set a mode that the driver does not support, SQLCODE and SQLSTATE are set accordingly.