Avoiding Natural Error 3009 (Adabas Timeout) in an RPC server

I published several Natural subprograms as a service in webMethods Integration Server via the EntireX adapter which uses a Natural RPC server on our SuSE Linux server to access the Natural modules. After a Natural service has not been called from the outside for a certain period of time (about 1 hour), the next call to the service always resulted in a Natural Error 3009:

NAT3009: Last transaction backed out of database :1:. Subcode :2:.

The Software AG documentation describes how to fix this problem: Avoiding Error Message NAT3009 from Server Program. However, there are a few additional things you need to check, to make sure that the solution works. Here is what I needed to do to make it work:

  • Copy NATRPC39 from library SYSRPC to library SYSTEM in your FUSER (System Libraries, not User Libraries!).
  • Edit SYSTEM.NATRPC39 and make sure every database gets pinged correctly:

    DEFINE DATA LOCAL
    01  ACB
      02  ACB-TYPE                      (B1) INIT<H'30'>
      02  ACB-FILL                      (B1)
      02  ACB-COMMAND                   (A2) INIT<'RC'>
      02  ACB-CID                       (A4) INIT<H'FFFFFFFF'>
      02  ACB-FILEID                    (B2)
      02  ACB-RSP                       (B2)
      02  ACB-ISN                       (B4)
      02  ACB-ISNL                      (B4)
      02  ACB-ISNQ                      (B4)
      02  ACB-FBL                       (B2)
      02  ACB-RBL                       (B2)
      02  ACB-SBL                       (B2)
      02  ACB-VBL                       (B2)
      02  ACB-IBL                       (B2)
      02  ACB-COP1                      (A1)
      02  ACB-COP2                      (A1)
      02  ACB-ADD1                      (A8)
      02  ACB-ADD2                      (A4)
      02  ACB-ADD3                      (A8)
      02  ACB-ADD4                      (A8)
      02  ACB-ADD5                      (A8)
      02  ACB-CMDT                      (B4)
      02  ACB-USER                      (A4)
    01  REDEFINE  ACB
      02 ACB-80                         (A80)
    END-DEFINE
    *
    RESET INITIAL ACB
    ACB-RSP := 1 /* DBID to ping
    CALL 'CMADA' ACB-80
    *
    RESET INITIAL ACB
    ACB-RSP := 2
    CALL 'CMADA' ACB-80
    *
    * add additional databases here
    *
    END
    
  • Check the setting SRVWAIT in the NATPARM of the RPC server. It needs to be greater than 0 and less than the TNA* settings for the Adabas database, e.g. 60 (seconds). The TNA* settings can be found in the database’s configuration file adanuc.prm.

  • Check the setting SERVER-NONACT in the Attribute File of the EntireX broker. It also needs to be less than the TNA* settings, e.g. 10M.

To make sure that NATRPC39 really gets called you may add a WRITE WORK part to its source like this:

DEFINE WORK FILE 1 '/tmp/NATRPC39.log' 
    TYPE 'UNFORMATTED' ATTRIBUTES 'APPEND'
#TIME := *TIMX
WRITE WORK 1 VARIABLE #TIME H'0A'
CLOSE WORK 1

In NATRPC39 be sure to only call modules in SYSTEM (as the Steplib chain is not evaluated) and check that it does not throw any runtime errors whatsoever! Any Natural error in NATRPC39 is silently ignored and not logged anywhere (or at least I found no log). To enable tracing for the RPC server to check whether the SRVWAIT works as expected (see Using the Server Trace Facility), you need to modify its NATPARM file: set TRACE to 2 and Trace on error to OFF. Then set the Report Assignment for Report 10 to Device LPT10 and set the Physical Output Device for Device LPT10 to something like this: /bin/sh -c cat>>/tmp/rpctrace.log. Be aware that the RPC server caches the log information. So you may need to deregister the RPC server after a few minutes to have it flush its log to the file.

Leave a Comment

To create code blocks or other preformatted text, indent by four spaces:

    This will be displayed in a monospaced font. The first four 
    spaces will be stripped off, but all other whitespace
    will be preserved.
    
    Markdown is turned off in code blocks:
     [This is not a link](http://example.com)

To create not a block, but an inline code span, use backticks:

Here is some inline `code`.

For more help see http://daringfireball.net/projects/markdown/syntax