Non-Java Applications receive SQL1034C (-1034) for connections to DB2 for z/OS V10 while Java Applications receive SQL0902C (-902)

Technote (troubleshooting)


Problem(Abstract)

Applications connected to the z/OS DB2 V10 product might receive an error indicating that a database is damaged. For example:

[IBM][CLI Driver] SQL1034C The database is damaged. All applications
processing the database have been stopped. SQLSTATE=58031

DB2 Connect Gateway servers see -1034 errors in db2diag.log file as:

2013-11-18-12.40.53.649321-300 E218048607E590 LEVEL: Error
PID : 9238 TID : 48009819711808PROC : db2sysc
INSTANCE: db2inst1 NODE : 000 DB : SAMPLE
APPHDL : 0-50688 APPID: 10.20.30.40.49284.131118123001
AUTHID : db2inst1
EDUID : 174 EDUNAME: db2agentg (SAMPLE )
FUNCTION: DB2 UDB, DRDA Application Server, sqljsTermAgentReply, probe:10
MESSAGE : DIA5000C A DRDA AS token "AGENT TERMINATING" was detected. The
diagnostic data returned is (SRVDGN): "SQLERRP:SQLJRERM
SQLCODE:-1034".

2013-11-18-12.40.53.650741-300 E218049198E841 LEVEL: Error
PID : 9238 TID : 48009819711808PROC : db2sysc
INSTANCE: db2inst1 NODE : 000 DB : SAMPLE
APPHDL : 0-50688 APPID: 10.31.177.59.49284.131118123001
AUTHID : db2inst1
EDUID : 174 EDUNAME: db2agentg (SAMPLE )
FUNCTION: DB2 UDB, DRDA Application Server, sqljsTermAgentReply, probe:11
DATA #1 : SQLCA, PD_DB2_TYPE_SQLCA, 136 bytes
sqlcaid : SQLCA sqlcabc: 136 sqlcode: -1034 sqlerrml: 0
sqlerrmc:
sqlerrp : SQLJRERM
sqlerrd : (1) 0x8037006D (2) 0x00000000 (3) 0x00000000
(4) 0x00000000 (5) 0x00000000 (6) 0x00000000
sqlwarn : (1) (2) (3) (4) (5) (6)
(7) (8) (9) (10) (11)
sqlstate: 58031


This error message might be followed by information that the z/OS timed out the connection due to IDTHOIN.

JDBC applications will receive a -902 or SQL0902C error.

Symptom

Non-Java Applications receive error indicating the database is damaged. For example, a CLI application might return the following error message:


[IBM][CLI Driver] SQL1034C The database is damaged. All applications
processing the database have been stopped. SQLSTATE=58031


The Java applications receive the SQL0902C error which indicates a system error.


Cause

Prior to applying the PM43293,PM81671 APARs for the z/OS DB2 V10 product, if a client connection did not commit in a time less than the configured IDTHTOIN zparm parameter, then the connection is terminated by the z/OS operating system.


The client might receive a SQL1224n or a SQL30081 error, *,* 0 message returned in the db2diag.log file the next time the connection was used.

If using a DB2 Connect Server as a gateway to clients, the SQL30081 error *.*.0 would be returned and a reconnection would be attempted if the environment was enabled for SYSPLEX. At this point, if the reconnection is successful, the application will receieve a SQL30108N message indicating that a reconnection was done and that the uncommitted data was rolled back. The application would then need to restart the processing to redo the information that had not been committed.

After the z/OS PM43293, PM81671 APARs have been applied, non-java applications receive the -1034 or SQL1034C messages and Java applications the receive -902C or SQL0902C messages.

These errors are very misleading and are severe errors.
Note that this error is only returned for clients running earlier versions of the DB2 client prior to the
DB2 V10 Fixpak 2 product.

Clients running DB2 V10 Fixpak 2 or later, will see the SQL1224N message returned. Note that the gateway DB2 will not reconnect when the -1224 is returned via Automatic Client Reroute.


Environment

DB2 LUW connections using the DB2 V10.1 Fixpak 1 product or earlier versions of the product.

Diagnosing the problem

Check the db2diag.log file for the following:

2013-11-18-12.40.53.649321-300 E218048607E590 LEVEL: Error
PID : 9238 TID : 48009819711808PROC : db2sysc
INSTANCE: db2inst1 NODE : 000 DB : SAMPLE
APPHDL : 0-50688 APPID: 10.20.30.40.49284.131118123001
AUTHID : db2inst1
EDUID : 174 EDUNAME: db2agentg (SAMPLE )
FUNCTION: DB2 UDB, DRDA Application Server, sqljsTermAgentReply, probe:10
MESSAGE : DIA5000C A DRDA AS token "AGENT TERMINATING" was detected. The
diagnostic data returned is (SRVDGN): "SQLERRP:SQLJRERM
SQLCODE:-1034".

2013-11-18-12.40.53.650741-300 E218049198E841 LEVEL: Error
PID : 9238 TID : 48009819711808PROC : db2sysc
INSTANCE: db2inst1 NODE : 000 DB : SAMPLE
APPHDL : 0-50688 APPID: 10.31.177.59.49284.131118123001
AUTHID : db2inst1
EDUID : 174 EDUNAME: db2agentg (SAMPLE )
FUNCTION: DB2 UDB, DRDA Application Server, sqljsTermAgentReply, probe:11
DATA #1 : SQLCA, PD_DB2_TYPE_SQLCA, 136 bytes
sqlcaid : SQLCA sqlcabc: 136 sqlcode: -1034 sqlerrml: 0
sqlerrmc:
sqlerrp : SQLJRERM
sqlerrd : (1) 0x8037006D (2) 0x00000000 (3) 0x00000000
(4) 0x00000000 (5) 0x00000000 (6) 0x00000000
sqlwarn : (1) (2) (3) (4) (5) (6)
(7) (8) (9) (10) (11)
sqlstate: 58031

Check the z/OS SYSLOG file to see if the 00D3003B message occurred indicating IDTHTOIN had terminated the connection.

This scenario can easily be recreated as follows from the clp using "+c" option of the DB2 CLP to run with autocommit off

C:\Users\IBM_ADMIN>db2 connect to s23cv10 user ts09742 using password

Database Connection Information

Database server = DB2 z/OS 10.1.5
SQL authorization ID = TS09742
Local database alias = S23CV10


C:\Users\IBM_ADMIN>db2 terminate
DB20000I The TERMINATE command completed successfully.

C:\Users\IBM_ADMIN>db2 +c connect to s23cv10 user ts09742 using Iluvbrs2

Database Connection Information

Database server = DB2 z/OS 10.1.5
SQL authorization ID = TS09742
Local database alias = S23CV10


C:\Users\IBM_ADMIN>db2 +c "create table test1 (col1 int)"
DB20000I The SQL command completed successfully.

-- Wait for time > IDTHTOIN then issue:

C:\Users\IBM_ADMIN>db2 +c "insert into test1 values(1)"

DB21034E The command was processed as an SQL statement because it was not a
valid Command Line Processor command. During SQL processing it returned:

SQL1224N The database manager is not able to accept new requests, has
terminated all requests in progress, or has terminated the specified request
because of an error or a forced interrupt. SQLSTATE=55032


The connection sat in an idle state for a period without committing. When the insert was attempted, the z/OS operating system had already forced off the connection because it was idle for too long.

The application receives the SQL1224N error message.


Resolving the problem

To resolve the issue for the older versions of the DB2 clients, ie V10 Fixpak 1 and earlier, z/OS APAR PM94517 must be applied. Once this is applied, the applications configured to use Automatic Client Reroute will again be reconnected. The SQL30108N message will be returned to the application if a successful reconnection occurs.


SQL30108N A connection failed but has been re-established. The hostname
or IP address is "<host-name>" and the service name or port number
is "<service-name>". Special register settings might have been
replayed. (Reason code = "<reason-code>").

If not successful, the application will receive the SQL1224N sqlcode.

As per this DB2 for z/OS APAR:
http://www-01.ibm.com/support/docview.wss?uid=swg1PM94517

On z/OS, the 00D3003B message will continue to be written to the z/OS SYSLOG.


The application should also be evaluated to determine why an open unit of work has been waiting so long to finish processing without committing. Once it has been waiting longer than the z/OS IDTHTOIN, it
will be terminated.

IDTHTOIN on DB2 for z/OS should be configured or tuned to accommodate how long the application needs to keep units of work idle for or the application should commit work more frequently.

Related information

APAR PM94517
APAR PM43293
APAR PM81671

Rate this page:

(0 users)Average rating

Add comments

Document information


More support for:

DB2 for Linux, UNIX and Windows
Connectivity - OS390/AS400/MVS

Software version:

9.5, 9.7, 9.8, 10.1

Operating system(s):

AIX, HP-UX, Linux, Linux iSeries, Linux pSeries, Linux zSeries, Solaris, Windows

Software edition:

Advanced Enterprise Server, Enterprise Server, Express, Personal, Workgroup Server

Reference #:

1656615

Modified date:

2014-02-06

Translate my page

Machine Translation

Content navigation