Question
· Sep 8

Testing Java Gateway ( EnsLib.JavaGateway.Service) Connection from Ens.BusinessOperation/EnsLib.SQL.OutboundAdapter

We currently have Business Operation that we built to use the EnsLib.SQL.OutboundAdapter so we can make Microsoft SQL Server Stored Procedure calls. The BO is attached to a Java Gateway Service.

Some of our MS SQL Databases have moved from being OnPrem to Azure Cloud. We have started seeing where we are receiving errors on the BO saying that we cannot connect to the Azure Database, but we never receive a Disconnect from the Azure Database.

Once this happens it seems that the Java Gateway still thinks the connection is opened, and we have to Stop/Start the Java Gateway to get the connection to resolve itself.

Is there a way that we could use EnsLib.JavaGateway.Service to test the connection and retry if we don't have a connection from our Business Operation so we can prevent a hung state. Currently I scripted within the Alerting to Stop/Start the Java Gateway if we alert on the Business Operation.

Product version: IRIS 2025.1
$ZV: IRIS for UNIX (Red Hat Enterprise Linux 8 for x86-64) 2025.1 (Build 230_2U) Wed Jun 4 2025 18:50:44 EDT [HealthConnect:8.2.2]
Discussion (2)2
Log in or sign up to continue

Stay Connected is set at 60, messages are sent to the BO in batches depending on when we receive the HL7 message that it requires a lookup. 

Because this is going through a Java Gateway Business Service it seems like there is a disconnect on when the BO loses connection and pipe that it uses through the Java Gateway Business Service. The BO loses the connection, but the Java Gateway Business Service still thinks it is connected to the Database.

I have tried adding Connection Attributes to the BO, but it has not help.

Business Operation Settings

  <Item Name="PatientBillingDBPoll" Category="PatientBilling,SQL,PROD,CC,VANW,PatFeeder" ClassName="osuwmc.PatientBilling.PatientBillingDBPollOperation" PoolSize="1" Enabled="true" Foreground="false" Comment="Is used to lookup items against clarity tables" LogTraceEvents="true" Schedule="">
    <Setting Target="Adapter" Name="Credentials"></Setting>
    <Setting Target="Adapter" Name="DSN">MS-PatientBilling</Setting>
    <Setting Target="Adapter" Name="JGService">PatientBilling.JavaGateway</Setting>
    <Setting Target="Host" Name="FailureTimeout">20</Setting>
    <Setting Target="Host" Name="ReplyCodeActions">E=R</Setting>
    <Setting Target="Host" Name="AlertOnError">0</Setting>
    <Setting Target="Adapter" Name="StayConnected">60</Setting>
    <Setting Target="Adapter" Name="ConnectionAttributes">"queryTimeout = 30";"socketTimeout = 60";"cancelQueryTimeout = 45";"connectRetryCount = 100";"connectRetryInterval = 5"</Setting>
    <Setting Target="Host" Name="ArchiveIO">1</Setting>
  </Item>

Java Gateway Settings

<Item Name="PatientBilling.JavaGateway" Category="PROD" ClassName="EnsLib.JavaGateway.Service" PoolSize="1" Enabled="true" Foreground="false" Comment="" LogTraceEvents="true" Schedule="">
    <Setting Target="Host" Name="Port">55558</Setting>
    <Setting Target="Host" Name="JavaHome">/usr</Setting>
    <Setting Target="Host" Name="Logfile"></Setting>
    <Setting Target="Host" Name="ClassPath">/nfs/data/drivers/java/*</Setting>
    <Setting Target="Host" Name="JVMArgs">-d64 -Xss512k -Xmx1024m -XX:+DisableExplicitGC -XX:+AggressiveOpts -XX:+ExplicitGCInvokesConcurrent -XX:+UseStringDeduplication -XX:MaxHeapFreeRatio=10 -XX:MinHeapFreeRatio=5</Setting>
  </Item>