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.

Locking impact on queries<br />

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

The <strong>Data</strong><strong>Server</strong> processes query statements marked with SHARE-LOCK and<br />

EXCLUSIVE-LOCK queries very differently from NO-LOCK queries.<br />

Note: There is an exception to the previous statement; queries marked SHARE-LOCK<br />

when the record isolation level is read uncommitted are treated like a NO-LOCK.<br />

The records of a NO-LOCK query are pre-fetched, which means that changes to the<br />

result set after the query has been executed are unknown. Records modified in the<br />

database after the query is established will not be reflected in the result set.<br />

SHARE-LOCK and EXCLUSIVE-LOCK queries do not pre-fetch records, but do preselect<br />

record keys. The query behavior is that of a “keyset-driven” cursor. Since the record<br />

keys are stored at the time an ABL query is first executed, new records added to the<br />

database since the key list was established are not included in the query result set.<br />

However, records that have been deleted or modified in the database will be reflected<br />

in the query results as records are accessed by the application.<br />

Locking examples<br />

The following example illustrates how the end of a transaction affects <strong>OpenEdge</strong> and<br />

MS <strong>SQL</strong> <strong>Server</strong> data source locks differently:<br />

DO TRANSACTION:<br />

FIND customer WHERE customer.custnum EQ 10.<br />

UPDATE customer.<br />

END.<br />

Note the following points:<br />

• When you access an <strong>OpenEdge</strong> database with this procedure, the customer<br />

record is share-locked when the first transaction ends.<br />

• When you access a MS <strong>SQL</strong> <strong>Server</strong> data source with the <strong>Data</strong><strong>Server</strong>, the<br />

customer record is released when the first transaction ends.<br />

<strong>OpenEdge</strong> <strong>Data</strong> <strong>Management</strong>: <strong>Data</strong><strong>Server</strong> <strong>for</strong> <strong>Microsoft</strong> <strong>SQL</strong> <strong>Server</strong> 97

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

Saved successfully!

Ooh no, something went wrong!