If your application has accessed a host or System i database server during a transaction,
there are some differences in how indoubt transactions are recovered.
To access host or System i database
servers, Db2
Connect is
used. The recovery steps differ if Db2
Connect has
the Db2 Syncpoint Manager configured.
About this task
The recovery of indoubt transactions at host or System i servers is normally performed automatically by the Transaction Manager (TM) and the
Db2 Syncpoint Manager (SPM). An
indoubt transaction at a host or System i server does not
hold any resources at the local Db2 location, but does
hold resources at the host or System i server as long as
the transaction is indoubt at that location. If the administrator of the host or System i server determines that a heuristic decision must be made, then
the administrator might contact the local Db2 database
administrator (for example via telephone) to determine whether to commit or roll back the
transaction at the host or System i server. If this
occurs, the LIST DRDA INDOUBT TRANSACTIONS command can be used to determine the
state of the transaction at the Db2
Connect instance.
Procedure
The following steps can be used as a guideline for most
situations involving an SNA communications environment:
- Connect to the SPM.
For example:
db2 => connect to db2spm
Database Connection Information
Database product = SPM0500
SQL authorization ID = CRUS
Local database alias = DB2SPM
- Issue the LIST DRDA INDOUBT TRANSACTIONS command
to display the indoubt transactions known to the SPM.
The
following example shows one indoubt transaction known to the SPM.
The db_name
is the local alias for the host or System i server. The partner_lu
is
the fully qualified luname of the host or System i server. This provides the best
identification of the host or System
i server, and should be provided by the caller from the host
or System i server. The luwid
provides
a unique identifier for a transaction and is available at all hosts
and System i servers. If
the transaction in question is displayed, then the uow_status
field
can be used to determine the outcome of the transaction if the value
is C (commit) or R (rollback).
If you issue the LIST DRDA INDOUBT TRANSACTIONS command
with the WITH PROMPTING parameter, you can commit,
roll back, or forget the transaction interactively.
db2 => list drda indoubt transactions
DRDA Indoubt Transactions:
1.db_name: DBAS3 db_alias: DBAS3 role: AR
uow_status: C partner_status: I partner_lu: USIBMSY.SY12DQA
corr_tok: USIBMST.STB3327L
luwid: USIBMST.STB3327.305DFDA5DC00.0001
xid: 53514C2000000017 00000000544D4442 0000000000305DFD A63055E962000000
00035F
- If an indoubt transaction for the
partner_lu
and
for the luwid
is not displayed, or if the LIST
DRDA INDOUBT TRANSACTIONS command returns as follows, then
the transaction was rolled back. db2 => list drda indoubt transactions
SQL1251W No data returned for heuristic query.
What to do next
There is another unlikely but possible situation that can occur. If an indoubt transaction
with the proper luwid
for the partner_lu
is displayed, but the
uow_status
is "I", the SPM does not know whether the
transaction is to be committed or rolled back. In this situation, you should use the WITH
PROMPTING parameter to either commit or roll back the transaction on the Db2 Connect workstation. Then
allow Db2 Connect to
resynchronize with the host or System i server based on
the heuristic decision.