DB2 : Errors when a database nickname or view is no longer available

By | January 5, 2017

In an enterprise application based on hibernate running over DB2 we have to refer with several views and nicknames to external tables. This can be the case when SSO is used or there are some common static data (accounts, user entries, financial constants etc. ) that are kept in a centralized database repository and are not part of our application.
When from some reason the nickname or view is no longer visible (communication problem, grants no longer valid etc.) we get a string of cryptic SQL errors like the following:

There are several DB2 error codes there that may make it more clear. Let us go through them :

STEP 1. SQL Error: -4229, SQLState: null

Translated: “Batch failure. The batch was submitted, but at least one exception occurred on an individual member of the batch. ”
Note: This is the top error at batch level so we have to go deeper to find the cause.

STEP 2. SQL Error: -1476, SQLState: 40506

Translated: Transaction roll-back due to batch element failure
Note: This informs us that an element of the transaction batch failed. We have to go to the batch element error that follows to see the cause.

STEP 3. Error for batch element #1: The current transaction was rolled back because of error “-30090”. Associated tokens: “”.. SQLCODE=-1476, SQLSTATE=40506, DRIVER=4.19.26

Translate: The error occurred when trying to process batch element #1, with the batch element SQL Error : “-30090”. Message also tells us this is a child error message for error at point 2.

STEP 4. SQL Error : “-30090”.



Translate: Non-recoverable chain-breaking exception occurred during batch processing. The batch is terminated non-atomically.On 12/10/2015 02:43 PM,
Note: This is just informing us that the transaction batch failed

In our case the operation for which we get SQL Error : “-30090” is done on BusinessCalendar table which is a NICKNAME to the BusinessCalendar from another tablespace.

This means that somehow you are not able to access the NICKNAME to the BusinessCalendar from the other tablespace. We do not have granted access rights, there are communication issues or some other issues the nickname is not accessible.



Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.