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 />

2–38<br />

If the client application does not specify NO-WAIT, then the application automatically loops back<br />

to the server in an internal wait mode and retries record access. It continues to do so until the<br />

Lock Timeout period set on the client (–lkwtmo parameter specified in seconds) is exceeded. If<br />

this wait period is exceeded without being able to successfully access the server resource, the<br />

process times out, the wait is canceled and the client raises a stop condition.<br />

When NO-WAIT is unspecified, the client consistently returns to the server to retry access to the<br />

locked resource. If NO-ERROR is also unspecified, then during the Lock Timeout period<br />

(-lkwtmo) a resource wait dialog box continues to be displayed to the user. It allows the user to<br />

select cancel from the dialog to end the wait period. If the user does not cancel and the –lkwtmo<br />

period has not been exceeded, the client per<strong>for</strong>ms constant retries and multiple round trips to the<br />

server. This constant re-cycling, especially during a period of high resource contention, can be<br />

normalized by setting a small timeout period on the server in which to handle lock conditions<br />

be<strong>for</strong>e returning timeouts to the client application. The server wait period is set through the<br />

PRGRS_NATIVE_LOCKWAIT –Dsrv connection parameter. The disadvantage to setting this<br />

parameter to a non-zero value is that the client application is blocked <strong>for</strong> the timeout period set<br />

on the server. This may produce some amount of server-bound latency that should be<br />

considered when setting the number of milliseconds <strong>for</strong> this option. However, if the server is<br />

able to complete the resource request in the server timeout period, the resource is returned to the<br />

client immediately and the application unblocks. There<strong>for</strong>e, the advantage of setting a non-zero<br />

server timeout is that the server is given the opportunity to resolve record access without further<br />

round trips from the client repeatedly request the same resource. A nonzero value may be<br />

especially useful during periods of high contention and may increase the overall efficiency of<br />

the <strong>Data</strong><strong>Server</strong> application. Progress recommends a nominal but non-zero setting <strong>for</strong> the<br />

number of milliseconds in most cases. Evaluate your average contention <strong>for</strong> resources in setting<br />

this value <strong>for</strong> your own application.<br />

The PRGRS_NATIVE_LOCKWAIT –Dsrv option permits an application to set a maximum time<br />

threshold that the server will block the application waiting to fulfill a resource request that is<br />

locked. When the server waits <strong>for</strong> the resource longer than the PRGRS_NATIVE_LOCKWAIT number<br />

of milliseconds, control is returned to the client application which then handles the lock<br />

condition as described earlier. As the PRGRS_NATIVE_LOCKWAIT time is increased, the number<br />

of retries from the client within the –lkwtmo period is decreased (assuming NO-WAIT is<br />

unspecified).<br />

The PRGRS_NATIVE_LOCKWAIT setting will affect all transactions <strong>for</strong> all connections to the<br />

<strong>for</strong>eign data source <strong>for</strong> a given application session. This includes read-only connections,<br />

stored-procedure connections, and transactions on the sequences connection.<br />

Note: Setting the PRGRS_NATIVE_LOCKWAIT is equivalent to setting the “LOCK_TIMEOUT”<br />

value natively in MS <strong>SQL</strong> <strong>Server</strong>.

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

Saved successfully!

Ooh no, something went wrong!