Written by

Sr Application Development Analyst at The Ohio State University Wexner Medical Center
Question Scott Roth · Mar 20, 2019

Query Response from MSSQL

I am having an intermittent issue that when I make a call to MSSQL from a BPL that the response does not come back in the amount of time required. Since the call from the BPL is synchronous I tried changing the timeout to 60 but it has not helped (see below). Is there anyway to guarantee that the call waits long enough for a response before continuing on?

Thanks

Scott Roth

Comments

Scott Roth  Mar 20, 2019 to Eduard Lebedyuk

I thought with external calls they could not be async.

0
Eduard Lebedyuk  Mar 20, 2019 to Scott Roth

You're calling an Operation, right?

Operations can be called in async mode.

0
Jeffrey Drumm · Mar 21, 2019

Scott,

The challenge here is defining what is "long enough enough for a response." One option is to wait forever, but that will have the effect of processing no further messages until the call completes. That can lead to resource contention and race conditions that could be unacceptable in a healthcare setting.

Better to set a timeout and then take some action when the operation fails to complete. Here's a COS example that could be used in a <code> activity in place of a <call>:

set callrequest.ResearchID = context.RschMRN
do process.SendRequestSync("PatientBillingDBPoll", callrequest, .callresponse, 60)
if ('$ISOBJECT(callresponse)) {
   // handle the timeout in here; suspend the message, perhaps?
} else {
   set context.ClarityRs = callresponse
}

This will wait 60 seconds for a response, and if none is received perform the actions in the 'if' consequence.

0