Topic
  • 9 replies
  • Latest Post - ‏2012-04-10T04:13:46Z by SystemAdmin
PaulG_TN
PaulG_TN
24 Posts

Pinned topic CLI0106E Connection is closed error

‏2010-09-29T11:55:59Z |
We have a .Net 3.5 windows services that is using the 32-bit v9.7 FP1 of the IBM.Data.DB2 dll. It's running on a Windows 2003 application server that has the DB2 Connect Server v9.7 FP1 installed. The service is pulling data from an iSeries LPAR at V5R4.

Intermittently, we are getting the following error when reading from a DB2DataReader:

ERROR 08003 IBM CLI0106E Connection is closed. SQLSTATE=08003

We were getting the same error on v9.5FP3 and hoped that the upgrade would help. It's been a few months now and it doesn't seem to have helped.

Any ideas about what might be the root cause here or how to track it down?
Updated on 2012-04-10T04:13:46Z at 2012-04-10T04:13:46Z by SystemAdmin
  • SystemAdmin
    SystemAdmin
    2826 Posts

    Re: CLI0106E Connection is closed error

    ‏2010-09-29T13:13:31Z  
    Hi,

    unfortunately, the problem you're seeing is to technical to be analyzed in a forum environment. Your best bet to resolve is to contact IBM technical support.

    PS: I assume you meant V9.7FP3 as your upgrade path, not V9.5FP3, right?

    Regards,
    Alex
  • PaulG_TN
    PaulG_TN
    24 Posts

    Re: CLI0106E Connection is closed error

    ‏2010-09-29T13:26:24Z  
    Hi,

    unfortunately, the problem you're seeing is to technical to be analyzed in a forum environment. Your best bet to resolve is to contact IBM technical support.

    PS: I assume you meant V9.7FP3 as your upgrade path, not V9.5FP3, right?

    Regards,
    Alex
    Thanks Alex.

    No, I meant v9.5. We were getting the same error on 9.5 and upgraded to 9.7FP1 to see if it would solve the problem and it didn't. I know that 9.7FP3 is out now, but we haven't yet pursued doing that upgrade. We were hoping to wait on the .net 4/VS2010 version to come out of beta and go straight to that.

    My hope was that this error had some common root causes that I might be able to track down, but we can open a ticket and work through support if that is a better approach.

    Thanks again
  • SystemAdmin
    SystemAdmin
    2826 Posts

    Re: CLI0106E Connection is closed error

    ‏2010-09-29T13:38:01Z  
    • PaulG_TN
    • ‏2010-09-29T13:26:24Z
    Thanks Alex.

    No, I meant v9.5. We were getting the same error on 9.5 and upgraded to 9.7FP1 to see if it would solve the problem and it didn't. I know that 9.7FP3 is out now, but we haven't yet pursued doing that upgrade. We were hoping to wait on the .net 4/VS2010 version to come out of beta and go straight to that.

    My hope was that this error had some common root causes that I might be able to track down, but we can open a ticket and work through support if that is a better approach.

    Thanks again
    Ah, I see. In that case I would suggest trying V9.5FP6 or V9.7FP3 ( or maybe even FP2 ). If I remember correctly there were fixes put into those releases that dealt with CLI0106 problem. I can't guarantee that you're seeing the exact same issue, as those we've previously encountered ( and fixed ) without deeper analysis ( which is not possible on the forum ), however, checking those releases is worth a try.

    Regards,
    Alex
  • SystemAdmin
    SystemAdmin
    2826 Posts

    Re: CLI0106E Connection is closed error

    ‏2010-10-26T15:57:56Z  
    We are also having the same problem, but with the Informix dll. It seems the core problem traces back to some shared, unmanaged code. The drivers have had serious problems with multithreaded applications for many, many versions now, and it seems there is some core, back end code that is still not thread-safe. This is the reason you see the issue intermittently, and why it problem never happens on a single-threaded Windows Forms application. My guess is you are using the driver inside of IIS or some other process that is inherently multi-threaded, right? We have opened numerous cases with IBM over the years, and the problem has improved somewhat, but we still do not have a stable, enterprise-grade driver for use in our .NET applications.

    I wish you lots of luck here, because this is not an easy problem to replicate (we got stonewalled when tech support couldn't reproduce the problem at-will on their side), and despite a lot of saber-rattling still fight this problem today.

    My suggestion is for you to find a way to trap when this error happens and recycle your IIS application pool or implement some other mitigating strategy as it will likely be a long time before IBM resolves the root of this nasty problem.
  • SystemAdmin
    SystemAdmin
    2826 Posts

    Re: CLI0106E Connection is closed error

    ‏2012-03-28T06:40:16Z  
    We are also having the same problem, but with the Informix dll. It seems the core problem traces back to some shared, unmanaged code. The drivers have had serious problems with multithreaded applications for many, many versions now, and it seems there is some core, back end code that is still not thread-safe. This is the reason you see the issue intermittently, and why it problem never happens on a single-threaded Windows Forms application. My guess is you are using the driver inside of IIS or some other process that is inherently multi-threaded, right? We have opened numerous cases with IBM over the years, and the problem has improved somewhat, but we still do not have a stable, enterprise-grade driver for use in our .NET applications.

    I wish you lots of luck here, because this is not an easy problem to replicate (we got stonewalled when tech support couldn't reproduce the problem at-will on their side), and despite a lot of saber-rattling still fight this problem today.

    My suggestion is for you to find a way to trap when this error happens and recycle your IIS application pool or implement some other mitigating strategy as it will likely be a long time before IBM resolves the root of this nasty problem.
    We are also having the same problem.
    I want to ask, mono project to rewrite the DB2 driver is better?
    some people use it?

    https://github.com/mono/mono/tree/master/mcs/class/IBM.Data.DB2
  • Arvind_Gupta
    Arvind_Gupta
    58 Posts

    Re: CLI0106E Connection is closed error

    ‏2012-04-06T01:16:07Z  
    Could you please provide more information on which version of DB2 driver you are having problem and which database you are connecting to?

    Please clarify, what do you mean by "mono project to rewrite the DB2 driver is better"?
  • SystemAdmin
    SystemAdmin
    2826 Posts

    Re: CLI0106E Connection is closed error

    ‏2012-04-09T06:19:06Z  
    Could you please provide more information on which version of DB2 driver you are having problem and which database you are connecting to?

    Please clarify, what do you mean by "mono project to rewrite the DB2 driver is better"?
    I am sorry .
    Version of DB2 :32-bit v9.5.2
    Version of DB2 driver: 9.0.0.2 (9.5.2.2)
    Exception likely to occur when multiple connections was open .

    "mono project to rewrite the DB2 driver is better" mean:
    Mono project rewrote the driver.
    _-Eric-'s Comment "The drivers have had serious problems with multithreaded applications for many, many versions now, and it seems there is some core, back end code that is still not thread-safe. _
    _ ... but we still do not have a stable, enterprise-grade driver for use in our .NET applications."_
    I think there is a problem(still not thread-safe) with the IBM official drivers.(Arbitrary conclusions)
  • bpgross
    bpgross
    627 Posts

    Re: CLI0106E Connection is closed error

    ‏2012-04-09T16:56:46Z  
    I am sorry .
    Version of DB2 :32-bit v9.5.2
    Version of DB2 driver: 9.0.0.2 (9.5.2.2)
    Exception likely to occur when multiple connections was open .

    "mono project to rewrite the DB2 driver is better" mean:
    Mono project rewrote the driver.
    _-Eric-'s Comment "The drivers have had serious problems with multithreaded applications for many, many versions now, and it seems there is some core, back end code that is still not thread-safe. _
    _ ... but we still do not have a stable, enterprise-grade driver for use in our .NET applications."_
    I think there is a problem(still not thread-safe) with the IBM official drivers.(Arbitrary conclusions)
    Alex's response to Paul's initial question indicated that there were fixes made in V9.5 FP6, whereas you are still on V9.5 FP2. I would suggest at least moving to that level that was identified.

    Our current level is V9.7 FP5 - which has quite a few enhancements above what is in V9.5 FP2.

    Eric's comment regarding this issue was specific to the Informix provider, which I take to mean the Informix provider that is part of CSDK. There were mufti-threaded issues with that .NET provider, and the recommended .NET provider for use with Informix servers is the DB2 .NET provider - as it supports all the new .NET features (eg. the Entity Framework).

    With respect to Mono - thee is no IBM provided or contributed .NET provider for Mono. The last customer I was involved with on Mono was successfully using the Mono bridge and our ODBC / CLI driver.

    Brent.
  • SystemAdmin
    SystemAdmin
    2826 Posts

    Re: CLI0106E Connection is closed error

    ‏2012-04-10T04:13:46Z  
    • bpgross
    • ‏2012-04-09T16:56:46Z
    Alex's response to Paul's initial question indicated that there were fixes made in V9.5 FP6, whereas you are still on V9.5 FP2. I would suggest at least moving to that level that was identified.

    Our current level is V9.7 FP5 - which has quite a few enhancements above what is in V9.5 FP2.

    Eric's comment regarding this issue was specific to the Informix provider, which I take to mean the Informix provider that is part of CSDK. There were mufti-threaded issues with that .NET provider, and the recommended .NET provider for use with Informix servers is the DB2 .NET provider - as it supports all the new .NET features (eg. the Entity Framework).

    With respect to Mono - thee is no IBM provided or contributed .NET provider for Mono. The last customer I was involved with on Mono was successfully using the Mono bridge and our ODBC / CLI driver.

    Brent.
    Thank you for your answer.

    I will try your solution.
    =======
    I think we should tell you the current understanding of the situation.
    According to the analysis of each time problem log, concluded:

    In the connection pool idle connection was over. The program must create a new connection, new connection is prone to this exception.
    Then, the program closes the connection, put it in the connection pool.
    Our program has a retry feature.
    However, the retry time, may still be obtained from the connection pool the connection(with problems).

    That marks the connection(with problems). When it closed, do not put it in the connection pool.
    Thanks again