need elaborate info on IBM DB2 error tokens while getting DataAccessException via hibernate

470 views Asked by At

I am using IBM DB2 and Hibernate in my java application. Whwnever I end up with a DataAccessException in my application I am getting a stacktrace like follows

DataAccessException: {}com.ibm.websphere.ce.cm.DuplicateKeyException: [jcc][50053][12311][3.65.102] T2zOS exception: [jcc][T2zos]T2zosPreparedStatement.readExecuteInternal:nativeExecute:9943: DB2 engine SQL error, SQLCODE = -803, SQLSTATE = 23505, error tokens = IX6040UC;000001136E ERRORCODE=-803, SQLSTATE=23505
    at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
    at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:80)
    at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:57)
    at java.lang.reflect.Constructor.newInstance(Constructor.java:540)

I am able to make sense out of almost all the items in stacktrace but this 000001136E in error tokens.What does it signify?

1

There are 1 answers

1
mustaccio On BEST ANSWER

The manual contains this explanation for SQLCODE -803:

AN INSERTED OR UPDATED VALUE IS INVALID BECAUSE THE INDEX IN INDEX SPACE indexspace-name CONSTRAINS COLUMNS OF THE TABLE SO NO TWO ROWS CAN CONTAIN DUPLICATE VALUES IN THOSE COLUMNS. RID OF EXISTING ROW IS X record-id

The tokens you see in the error message map to the variables in the error explanation: "IX6040UC" is the index space name, while "000001136E" is the hexadecimal representation of the RID (record ID) of the existing record that already has the value that you are trying to insert or update.

I don't have a system to test with, but you could try this query to fetch the existing record:

select * from yourtable where RID(yourtable) = 70510

70510 is the decimal representation of the hexadecimal RID 0x1136E.