Cursors WITH HOLD

Informix®

Informix closes opened cursors automatically when a transaction ends, unless the WITH HOLD option is used in the DECLARE instruction:
DECLARE c1 CURSOR WITH HOLD FOR SELECT ...
OPEN c1
BEGIN WORK
FETCH c1 ...
COMMIT WORK
FETCH c1 ...
CLOSE c1

IBM® DB2®

IBM DB2 can keep cursors open across transactions, when the transaction is terminated with COMMIT.

When a transaction is canceled with a ROLLBACK, DB2 automatically closes all cursors.

Solution

Check that your source code does not use WITH HOLD cursors after transactions canceled with ROLLBACK.