How to set the isolation level with the SNC native database interface

Symptom

This document explains how to prevent from getting locks in a PowerBuilder application when the transaction isolation level is set to READ COMMITTED at the database level

Environment

  1. PowerBuilder

  2. Microsoft SQL Server 2008

  3. Microsoft SQL Server Native Client (SNC) for SQL Server 2008

Cause

At the client level, Lock database parameter was not specified in the Transaction object properties

Solution

Set the Lock value to RC for a SNC native database interface, even though it is the default value. For instance:

SQLCA.DBMS="SNC SQL Native Client(OLE DB)"
SQLCA.ServerName="XXX"
SQLCA.LogId="YYY"
SQLCA.LogPass="ZZZ"
SQLCA.DBParm="Provider='SQLNCLI11',Database='MySQLServerDB',DelimitIdentifier=1,StaticBind=0,DisableBind=0,NCharBind=0"
SQLCA.Lock ='RC'