Default Isolation Levels for SAP ASE and ANSI SQL

By default, the SAP ASE transaction isolation level is 1. The ANSI SQL standard requires level 3 to be the default isolation for all transactions. This prevents dirty reads, nonrepeatable reads, and phantom rows.

To enforce this default level of isolation, Transact-SQL provides the transaction isolation level 3 option of the set statement. This option instructs SAP ASE to apply a holdlock to all select operations in a transaction. For example:

set transaction isolation level 3

Applications that use transaction isolation level 3 should set that isolation level at the beginning of each session. However, setting transaction isolation level 3 causes SAP ASE to hold any read locks for the duration of the transaction. If you also use the chained transaction mode, that isolation level remains in effect for any data-retrieval or modification statement that implicitly begins a transaction. In both cases, this can lead to concurrency problems for some applications, since more locks may be held for longer periods of time.

To return your session to the SAP ASE default isolation level:

set transaction isolation level 1