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:
FUSER(System Libraries, not User Libraries!).
SYSTEM.NATRPC39and 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
NATPARMof the RPC server. It needs to be greater than
0and less than the
TNA*settings for the Adabas database, e.g.
TNA*settings can be found in the database’s configuration file
Check the setting
SERVER-NONACTin the Attribute File of the EntireX broker. It also needs to be less than the
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
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 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.