13.01.2013 Views

OpenEdge Data Management: DataServer for Microsoft SQL Server

OpenEdge Data Management: DataServer for Microsoft SQL Server

OpenEdge Data Management: DataServer for Microsoft SQL Server

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

Initial Programming Considerations<br />

<strong>Data</strong> source record locking<br />

2–36<br />

In a <strong>Data</strong><strong>Server</strong> application, MS <strong>SQL</strong> <strong>Server</strong> handles all of its own locking issues. ABL locking<br />

rules are modified when you access in<strong>for</strong>mation from a MS <strong>SQL</strong> <strong>Server</strong> data source. As a result,<br />

the <strong>OpenEdge</strong> phrases NO–LOCK and SHARE–LOCK have isolation-level dependencies. The<br />

EXCLUSIVE-LOCK behaves the same in MS <strong>SQL</strong> <strong>Server</strong> as in an <strong>OpenEdge</strong> database.<br />

Table 2–13 provides data source specific comparisons.<br />

Table 2–13: <strong>OpenEdge</strong> database and data source locking<br />

<strong>OpenEdge</strong> <strong>Data</strong> source<br />

NO–LOCK Supports the NO–LOCK option in a manner consistent with the<br />

<strong>OpenEdge</strong> database when transaction isolation level is set to read<br />

uncommitted.<br />

SHARE–LOCK Supports shared locks at the table, page, and record level.<br />

However, the scope and duration of the <strong>OpenEdge</strong> database vs.<br />

MS <strong>SQL</strong> <strong>Server</strong> shared locks can differ depending on how data<br />

source cursors behave at a transaction boundary and how isolation<br />

levels are set. The repeatable read isolation level emulates the<br />

<strong>OpenEdge</strong> database SHARE-LOCK behavior most closely. For more<br />

in<strong>for</strong>mation, see your MS <strong>SQL</strong> <strong>Server</strong> documentation.<br />

EXCLUSIVE–LOCK Supports the EXCLUSIVE-LOCK option in a manner consistent with<br />

the <strong>OpenEdge</strong> database using any available isolation level.<br />

However, the MS <strong>SQL</strong> <strong>Server</strong> optimizer might produce locks at<br />

either the table, page, or the record level.<br />

The <strong>Data</strong>Direct drivers provide four transaction isolation levels in the following order from least<br />

to most restrictive: read uncommitted, read committed, repeatable read, and serializable. In a<br />

multi-user configuration, you can isolate users from each other in your data source by setting<br />

the isolation level. In your <strong>OpenEdge</strong> schema holder, use the –Dsrv TXN_ISOLATION,n<br />

connection parameter (where n = 1, 2, 4, or 8) to set the isolation level in ODBC. See <strong>Microsoft</strong><br />

documentation and the MS <strong>SQL</strong> <strong>Server</strong> documentation <strong>for</strong> more in<strong>for</strong>mation.<br />

Note: MS <strong>SQL</strong> <strong>Server</strong> might use page-level or table-level locking rather than record-level<br />

locking, if its optimizer determines this is the best choice. This can affect data access<br />

when two or more users attempt to read or update different records that are on the same<br />

page. See your MS <strong>SQL</strong> <strong>Server</strong> documentation <strong>for</strong> details.<br />

Table 2–14 shows the possible –Dsrv TXN_ISOLATION,n values with the respective meaning.<br />

Table 2–14: TXN_ISOLATION values in the –Dsrv parameter<br />

Value Meaning<br />

1 Read uncommitted (default)<br />

2 Read committed<br />

4 Repeatable read<br />

8 Serializable

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!