S6BD2036E Error Returned from Distributed DB2 Call accompanied by SQLCODE -904

S6BD2036E Error Returned from Distributed DB2 Call accompanied by SQLCODE -904

book

Article ID: KB0088694

calendar_today

Updated On:

Products Versions
TIBCO Service Gateway for DB2 -
Not Applicable -

Description

Resolution:
DB2 accesses may fail with message S6BD2036E and SQLCODE -904 if a previous access was made to a distributed DB2 table and the the distributed link times out due to the inactivity limit set by the IDLE THREAD TIMEOUT (IDTHTOIN) field for the distributed DB2-to-DB2 link.

Environment:
==========
-TIBCO Service Gateway for DB2 running under z/OS
-accesses made from Service Gateway for DB2 to remote distributed DB2 table
-distributed link between two DB2 systems defined with DB2's IDLE THREAD TIMEOUT (IDTHTOIN) specification


Symptoms:
=========
Error message:
1) S6BD2036E serverid sessionid HDB2SEL: SQLCODE -904 PREPARE. UNSUCCESSFUL EXECUTION CAUSED BY AN UNAVAILABLE RESOURCE. REASON 00D31026, TYPE OF RESOURCE 00001002, AND RESOURCE NAME DB2_resource_name    

followed by other messages such as:
2) S6BD2036E serverid sessionid HDB2SEL: SQLCODE -918 . THE SQL STATEMENT CANNOT BE EXECUTED BECAUSE A CONNECTION HAS BEEN LOST


Cause:
=====
If the TIBCO Service Gateway for DB2 parameter SCOPE=SESSION is specified or defaulted and the DB2 IDLE THREAD TIMEOUT specification is active for a remote DB2 distributed link, then any accesses to distributed data over the link may leave the link idle and exceed the idle thread timeout limit. Subsequent accesses to the Gateway using the assigned sessionid will fail with a "resource unavailable" error condition in DB2. This is because the TIBCO Data Object Broker to TIBCO Service Gateway thread is held active with SCOPE=SESSION and therefore DB2 still considers the remote Database Access Thread active to the Gateway. If no activity occurs within the DB2 IDLE THREAD TIMEOUT limit, the Database Access Thread link is terminated and subsequent requests for the sessionid in question will fail.

Resolution:
=========
This error can be eliminated by:
1) removing the DB2 IDLE THREAD TIMEOUT specification -or-
2) changing the SCOPE=SESSION to SCOPE=TRANSACTION in the TIBCO Service Gateway for DB2 configuration parameters.


References:
==========
1) IBM Performance Monitoring and Tuning Guide: DB2 for z/OS
2) TIBCO® Object Service Broker Messages With Identifiers Software Release 5.2.0
3) TIBCO Service Gateway™ for DB2 Installing and Operating Software Release 5.2.0

Issue/Introduction

S6BD2036E Error Returned from Distributed DB2 Call accompanied by SQLCODE -904