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

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

Initial Programming Considerations<br />

2–44<br />

Executing the above code against the <strong>Data</strong><strong>Server</strong> will have different results because the<br />

<strong>Data</strong><strong>Server</strong> does not retain any lock conditions beyond the scope of the transaction boundary.<br />

The <strong>Data</strong><strong>Server</strong> will release the EXCLUSIVE-LOCK on the record at the END statement of<br />

Transaction 1. This leaves the record exposed to modification by another client during the PAUSE<br />

statement. If another client modifies the state-name value to “Granite State” during the PAUSE,<br />

Transaction 2 will read the updated value during the FIND statement. However, because of<br />

<strong>OpenEdge</strong> buffering rules and record scoping, neither buffer is refreshed with the updated value<br />

and the DISPLAY statement displays “New Hampshire New Hampshire.”<br />

To avoid this type of problem, the following workarounds are available:<br />

• Change the lock status in Transaction 1 to NO-LOCK if an EXCLUSIVE-LOCK is not required.<br />

The lock upgrade in Transaction 2 will <strong>for</strong>ce the buffer to be updated in this transaction.<br />

• If the lock can not be changed in Transaction 1, release the first buffer be<strong>for</strong>e the start of<br />

Transaction 2 with the statement “RELEASE st_buf1.” The RELEASE statement will <strong>for</strong>ce a<br />

refresh of the data when the FIND in Transaction 2 executes.

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

Saved successfully!

Ooh no, something went wrong!