Helpful Information
 
 
Category: DB2 Development
Odbc.net Error When Connecting To Db2

I am using ODBC.Net to connect to DB2 and I get this error randomly.

"ERROR [08001] [IBM][CLI Driver] SQL30081N A communication error has been detected. Communication protocol being used: "TCP/IP". Communication API being used: "SOCKETS". Location where the error was detected: "". Communication function detecting the error: "connect". Protocol specifi
ERROR [IM006] [Microsoft][ODBC Driver Manager] Driver's SQLSetConnectAttr failed"


Any help on this will be appreciated.

Thanks
Jagan.

Give me some more details:

What are you connecting from (language) and what OS are you connecting to? Is it DB2 on WIN or AS400? What data driver are you using? (Client that connects you to the DB2 Library?)

Also, are you trying to use ADO in .NET? or are you trying to use ADO.NET?

Thanks!

I am using Windows 2000 Professional with IIS 5.0. Using ADO.net with ODBC.Net. Its DB2 on Mainframe UDB and I connect using CAE

The error is likely due to a connection pool on the mainframe that is running over. On a mainframe, each connection is maintained seperately. And ADO.NET uses a new connection for each and every request.

The amount of connections available to the pool are limited by the MAINFRAME. SO... either have the admin guys watch the pool limit and either make the old ones die faster or add more available connections to the pool.....

OR...

You are not setting your connections to NOTHING just after you are done using it.

Dim OLEDBCONN as blah blah blah.....

OdedbConn = NOTHING

This will kill the connection as well... Other wise the mainframe has to expire it itself.

Hope this helps!

I am doing a ODBCConnection.Close() after running the query. I will try to get more info on the connection pool on the mainframe.

Thanks for your reply.
Jagan.

hi
can you tell me which driver and gateway i have to use to connect to db2. i am using windows xp professional, c#, odbc.net. can you tell me where i will get more info

thanks
sri

I AM EVEN FACING THE SAME PROBLEM. I HOPE YOU MIGHT HAVE GOT THE WAY TO CORRECT IT BY NOW.
I NEED TO CONNECT TO MAINFRAME DB2 FROM A MICROSOFT 2000 PROFESSIONAL OS USING VB.NET AND ODBC WITHOUT USING ANY THIRD PARTY TOOL.
KINDLY CONVEY IT TO ME AT MY EMAIL ID PUNEET_KUMAR_GULATI@YAHOO.CO.IN


THANKS





I am using ODBC.Net to connect to DB2 and I get this error randomly.

"ERROR [08001] [IBM][CLI Driver] SQL30081N A communication error has been detected. Communication protocol being used: "TCP/IP". Communication API being used: "SOCKETS". Location where the error was detected: "". Communication function detecting the error: "connect". Protocol specifi
ERROR [IM006] [Microsoft][ODBC Driver Manager] Driver's SQLSetConnectAttr failed"


Any help on this will be appreciated.

Thanks
Jagan.

WE HAVE THE SAME ISSUE BUT HAVE FOUND A WORKAROUND UNTIL IBM / MICROSOFT CLEARS THE ISSUE. IT APPEARS THAT MICROSOFT HAS A FIX FOR ODBC.NET DRIVERS TO ADDRESS THE INVALID CONNECTION POOL. ON DB2 SIDE YOU WILL NEED TO INSTALL A NEW FIXPAK5 GATEWAY AND CLIENT.

HOWEVER HERE IS THE CODE THAT WE IMPLEMENTED TO SOLVE THE DB2 DRIVER DISCONNECT ISSUE.

catch (Exception ex)
{
IBM.Data.DB2.DB2ConnPool.PurgePool();
throw new Exception("Error occurred calling 'DB2()'", ex);
}


GOOD LUCK..

LET ME KNOW IF THIS WORKS FOR YOU.










privacy (GDPR)