IBM CLI #verifyNoError:infoType:hstmt:ifError:

VA Smalltalk is a "100% VisualAge compatible" IDE that includes the original VisualAge technology and the popular VA Assist and WidgetKit add-ons.

Moderators: Eric Clayberg, wembley, tc, Diane Engles, solveig

IBM CLI #verifyNoError:infoType:hstmt:ifError:

Postby waynej » Mon Sep 29, 2008 12:57 pm

In the 7/9/2003 edition of AbtIbmCliDatabaseConnection>>#verifyNoError:infoType:hstmt:ifError:, note the whileFalse: loop. It will remember the first error in 'sqlstate' which is used in creating the AbtError returned from the method. Remembering the first error sounds like a good idea in general, but:

See how ... ll1320.htm describes the 01S01 as an indicator of partial success or partial failure, where actual failure is the second error. So #verifyNoError:infoType:hstmt:ifError: does log that second error, but callers have no idea it happened.

My application runs on Windows and connects to a DB2 database. By hand I can lock a table to cause a DB2 lock timeout, and if the database is on Windows, I get sqlstate=57033. But if the database is on a mainframe, the 01S01 comes into play and because of the above, my code will get sqlstate=01S01. I do see the sqlstate=57033 logged but it's not in the AbtError.

You see, my code looks at AbtError instances and tries to decide whether the failure is something that should be retried (like connection errors or DB2 lock timeouts) versus something that should cause an abort immediately. So should I patch #verifyNoError:infoType:hstmt:ifError: to allow a second error to overwrite a 01S01? Or should my higher level code figure that if we get 01S01, it's probably something like a lock timeout so I should retry?
Posts: 32
Joined: Wed Apr 18, 2007 9:18 am

Re: IBM CLI #verifyNoError:infoType:hstmt:ifError:

Postby tc » Thu Oct 02, 2008 12:30 am


I read your message but I am not able to verify it against a mainframe.

In general, I would change the code that looks at AbtError and have it try and figure out if the problem is a lock timeout.

However, if you feel comfortable with your change and it gives you the behavior you want then use that.

It is very hard to give a hard fast answer in a situation like this, such as, 'use your change'.

If it were me, I would modify the higher level code first.

Posts: 304
Joined: Tue Oct 17, 2006 7:40 am
Location: Raleigh, NC

Return to VA Smalltalk 7.0, 7.5 & 8.0

Who is online

Users browsing this forum: Yahoo [Bot] and 1 guest