DB2 Connection hang

63 views
Skip to first unread message

Ralf

unread,
Oct 29, 2019, 2:13:51 PM10/29/19
to VA Smalltalk
Hi All,

we have a problem with connections to a DB2 database. Apparently our application hangs when trying to connect to the database and you can only kill the process. Unfortunately, the behavior can not be easily reproduced, it sometimes occurs or not. Most of the time, if the catalog entry for the database binding was recreated. It then helps to connect over the command line tool, query a table and disconnect. Then our program can connect to the database and will work.
So I wanted to try to connect to the database without a catalog entry, but instead of server name, port and database name. Maybe it can solve the problem. Unfortunately, I do not find any clue for this, if and if so, how I can do that. So I'm grateful for any help.

Thanks

Ralf

Joachim Tuchel

unread,
Oct 29, 2019, 4:28:10 PM10/29/19
to VA Smalltalk
Ralf,

we've seen issues similar to what you describe. We can connect, but some queries will not be answered in reasonable time (while the exact same sql issued on the command line will be answered by the same database quickly and nicely),
In our case, it helps to issue an "db2 force application all" on the db server. This is only feasible in a test environment, obviuosly. We get a db2 connection error and can reconnect without restarting the image in such cases. We've tried to find hints as to what causes these hickups, but so far we found nothing.

So this message is not much more than a warm "you are not alone". But maybe that helps a little ;-)

Joachim

Wayne Johnston

unread,
Oct 29, 2019, 5:54:40 PM10/29/19
to VA Smalltalk
Ralf, I don't know what you mean by "the catalog entry for the database binding was recreated".  But we have applications that use DB2 a great deal, and I don't remember a problem with connecting to the database (except of course if we are up against MAXAPPLS).  Also the fact that a command line connect/query/disconnect happens to fix things sounds weird as well.

Ralf

unread,
Oct 30, 2019, 5:42:09 AM10/30/19
to VA Smalltalk
Thanks Joachim, for your warm words.:)

@Wayne Sorry, my english is not so good. For a DB2 connection normally you "catalog" the server and then the database on your client machine. So the client know the connection informations for the database you will connect. But, you can connect to the database without catalog entry, give servername, port, databasename and credentials, JDBC as example can do so, Delphi too. Delphi is using CLI, thats is why I think that Smalltalk can do as well.What I need is the knowledge for a DB2 connection via Smalltalk without catalog entry for testing. Our customer is a bit angry and I need a solution to the problem.


Joachim Tuchel

unread,
Oct 30, 2019, 6:39:32 AM10/30/19
to VA Smalltalk
Ralf,

I am not sure you can use the CLI driver to connect to an uncataloged db. My DB2-knowledge is too limited for this.
But I would guess that a good test would be if you can use the DB2 cli on your client machine (the one running the Smalltalk image) without any problems when this happens. It should be possible to do a "db2 connect to myDB user user using pw" in a DB" command line. This way you can probably find out quite quickly if you have a Smalltalk or a DB2 configuration problem.

Having to uncatalog and re-catalog pretty much sounds like a DB2 problem to me..... *headscratch*



Joachim

Joachim Tuchel

unread,
Oct 30, 2019, 6:41:48 AM10/30/19
to VA Smalltalk
Another question: which of the ca. 140 different DB2 client products are you using on your machines?
What platforn are you on?

Joachim Tuchel

unread,
Oct 30, 2019, 6:43:06 AM10/30/19
to VA Smalltalk
And yet another one: have you taken a look at the db2diag.logs on both the DB and the client machines? Do these offer any insights?

Joachim

Ralf

unread,
Nov 15, 2019, 12:11:23 PM11/15/19
to VA Smalltalk
Hello Joachim

I have no idea which excatly version of DB2 our costumer is using. He has a few dfifferent enviroments with different servers. And so far as I know, no infos in db2diag. For me, I have found a solution to connect to DB2 without catalog. The connection string can include the server name and port. An example:

Driver={IBM DB2 ODBC DRIVER};Database=DBNAME;Hostname=db2servername;Port=50000;Protocol=TCPIP;Uid=UID;Pwd=password

will work under windows. The bad news: On Linux it will not work without a few changes. The good news, I could use the windows code under Linux, so it will run now.

My curses, which I have expelled while reading the Linux code, I'll leave that aside.
 
I will inform here, when I have a feedback from our costumer.

If you are looking for the classes, start with AbtIbmCliDatabaseConnection, AbtIbmCliDatabaseManager
Reply all
Reply to author
Forward
0 new messages