How to disable dns cache for JCo library

How to disable dns cache for JCo library

book

Article ID: KB0073918

calendar_today

Updated On:

Products Versions
TIBCO ActiveMatrix BusinessWorks Plug-in for SAP Solutions 8.x

Description

In the TIBCO Cloud Integration environment, user could use tibagent to work with on-premise SAP server. If the SAP plugin configuration uses hostname for the SAP server host, the JCo library will resolve IP address and cache the IP address for further use. Since Jco connects to tibagent in such scenario, the resolved IP address would be the IP address that tibagent assigned to the spec. When tibagent restarts, the tibagent may assign a different IP address to the spec, However, JCo will not aware of this change, and thus the SAP connection would fail with below error:

ERROR partner '<hostname>:<service port>' not reached
TIME Tue Aug 11 14:54:39 2020
RELEASE 721
COMPONENT NI (network interface)
VERSION 40 RC -10 MODULE nixxi.cpp
LINE 3283
DETAIL NiPConnect2: <the ip address of the spec before restart the tibtunnel>:<service port>
SYSTEM CALL connect
ERRNO 111
ERRNO TEXT Connection refused
COUNTER 51

Environment

TIBCO Cloud Integration

Resolution

To resolve this issue, add following java properties to the engine variables:
-Djco.ni.dnscache.ttl=0 -Djco.ni.dnscache.negative.ttl=0

Issue/Introduction

How to disable dns cache for JCo library

Additional Information

https://sapnwnewbie.blogspot.com/2011/12/dns-caching-in-sap-jvm.html
https://www.int13h.nl:8443/_content/SAPDocuments/JCo_API_3_0/com/sap/conn/jco/JCo.html