IBM Support

SQL1822N Unexpected error code "-7008" received when trying to insert data into an iSeries database

Troubleshooting


Problem

Optim is connected to an iSeries database via nicknames created in DB2, using Federation Server and the DRDA wrapper. If the source tables are journaled, and the target tables are not, then a restore of archived data using insert may result in an error such as the following: Insert Process Errors: Data Base Error Detected in dbaliasname.ownerid.tablename: SQL1822N Unexpected error code "-7008" received from data source "XXXXXXX". Associated text and tokens are " SQL7008N REXX variable "tablename " contains inconsi". SQLSTATE=560BD

Symptom

SQL1822N Unexpected error code "-7008" received from data
source "XXXXXX".

Cause

When you connect from DB2 for Linux, Unix, and Windows, Version 9.5 to an OS/400® database by using nicknames in the local database, SELECT statements process successfully but INSERT, UPDATE, and DELETE operations result in SQL error code -7008.

Diagnosing The Problem

SQL1822 error with error code -7008 will appear immediately upon insert.

Resolving The Problem

1. You can use the SET PASSTHRU statement to resolve this problem. For example: 

SET PASSTHRU SERVER1; 
                                                                 
INSERT INTO TEST (cusnum) VALUES ( 19923 ) WITH NC; 
        
SET PASSTHRU RESET; 

2. IBM WebSphere Federated Server 9.5 Fix Pack 7 contains a new server option "APP_ISOLATION_ENABLE", which resolves this problem.

If this option is set to 'Y', Federation Server will get isolation level from the application, and set application isolation as a connect attribute.

If this option is set to 'N', Federation Server won't set isolation when connecting to client. The client can then use the isolation set in the configuration file, such as db2cli.ini.

To resolve the issue:

1. Set APP_ISOLATION_ENABLE to 'N'.

2. Set TXNIsolation to 32 in db2cli.ini:


[common]
TXNIsolation=32

3. Run db2stop and db2start.

[{"Product":{"code":"SSMLQ4","label":"IBM InfoSphere Optim Test Data Management Solution"},"Business Unit":{"code":"BU059","label":"IBM Software w\/o TPS"},"Component":"--","Platform":[{"code":"PF012","label":"IBM i"},{"code":"PF033","label":"Windows"}],"Version":"7.1.0;7.1.1;7.1.2;7.2;7.2.0;7.2.1;7.2.2;7.3;7.3.1;8.1","Edition":"","Line of Business":{"code":"LOB10","label":"Data and AI"}}]

Document Information

Modified date:
08 July 2021

UID

swg21577791