Failure Timeout and Reply action code SQL.OutboundAdapter

Primary tabs

Hi:

I have an sql outbound adapter. Sometimes we have trouble connecting to the database. 

The timeout in develpment is set to 15 seconds in live it is 150 seconds as it is an always connected Buisness operation. 

I thought adding E=S or/and X=S would suspend the message. Why does it not? 

Is the only way around then adding something to the buisness operation itself/ creating a customised SQL buisness operation rather than EnsLib.SQL.OutboundAdapter?

 

Thanks 

Mark

Replies

Hi Mark,

Please read the following doc:

https://cedocs.intersystems.com/latest/csp/docbook/DocBook.UI.Page.cls?KEY=ESQL_outbound
 

From what I understand, you need to create a custom Business Operation that would refer to the Adapter.

ReplyCodeActions only work on a Business Operation. not the Adapter itself. 

You can customize the Adapter if the default version does not do what you need and then refer to the Customized adapter in your Business Operation.

Hi:

It is from a buisness operation Penn.EDT.BO.ElectronicLettersLookupExtends Ens.BusinessOperation
{ Parameter ADAPTER = "EnsLib.SQL.OutboundAdapter";

I would have thought it would have suspended from the following 

Set tSC = ..Adapter.ExecuteQuery(.rs, sql,args...)
if $$$ISERR(tSC) {
Do pResponse.Errors.Insert($System.Status.GetErrorText(tSC))

It turns out it wouldn't suspend because the code was quitting with a $$OK rather than the status. 

It now does suspend the message but as there was no pResponse the operation still waits 15 seconds for timeout and then doesn't display in the production viewer with the purple/red dot if there was no suspending applied. Snippets that get called are below. 

Method LookupDefault(pRequest As Penn.EDT.Messages.InputData, Output pResponse As Penn.EDT.Messages.PatientLookupResponse) As %Status
{
Quit ..DoLookup(.pResponse, sql,pRequest.NHSNumber, source)
}

Method DoLookup(Output pResponse As Penn.EDT.Messages.PatientLookupResponse, sql As %String, args...) As %Status
{
    Set tSC = $$$OK
    Set pResponse = ##class(Penn.EDT.Messages.PatientLookupResponse).%New()
        Set tSC = ..Adapter.ExecuteQuery(.rs, sql,args...)
    if $$$ISERR(tSC) {
        Do pResponse.Errors.Insert($System.Status.GetErrorText(tSC))
    } Else {
        Do ..GetResults(rs,$G(args(2)),pResponse)    
    }
    
    Quit tSC
}

}

I think the error needs to give a response to the calling object, how can i do this? 

Hi Mark,

Try to add to your Else statement something that would check for the existence of a returned ResultSet as in

If '$IsObject (rs) (make it false or true depending on your logic)

Then if no result set it should error our without waiting if you do not direct a retry in ReplyCodeActions on the Operation.

Hi:

Thanks, this doesn't seem to make any difference though