Long running Asynchronous bean causing hanging threads in DB2 - Websphere

This is a discussion on Long running Asynchronous bean causing hanging threads in DB2 - Websphere ; Hi, We have a long running asynchronous bean (say B1) starting out of a Servlet init. This bean sleeps(using Thread.sleep) and wakes up every few minutes and checks for existence of a record in the database. If record exists, then ...

+ Reply to Thread
Results 1 to 5 of 5

Thread: Long running Asynchronous bean causing hanging threads in DB2

  1. Long running Asynchronous bean causing hanging threads in DB2

    Hi,

    We have a long running asynchronous bean (say B1) starting out of a Servlet init. This bean sleeps(using Thread.sleep) and wakes up every few minutes and checks
    for existence of a record in the database. If record exists, then it invokes a process (say P) that can run one hour or more.
    During processing, P opens numerous database connections following Open-Use-Close policy. The process (P) can also be run through
    Servlet GET request (say G) by a user as needed. Database connections used by P belong to multiple datasources.

    When P is invoked through Servlet GET request (G) everything works fine.
    But when P is invoked through a long running Async Bean it leaves a hanging thread in DB2 database.
    Thread sits there as long as Async Bean is running (till server restart).

    I have spend quite a time to resolve this issue and I have made little progress.
    If you know the reason or solution please share your knowledge.

    We are running DB2 version 9 on MVS, WAS version 6.1.0.21 on Linux.
    My min connections are 0. Connection timeout is 300 secs. Agetimeout is 1200.


    Thanks for your help.

  2. Re: Long running Asynchronous bean causing hanging threads in DB2

    Are you sure you're closing the connections for every one you're
    opening?

    Any finally blocks you should have connection.close(); calls in?

    You might have to trace the JDBC calls, so that you can see when each
    connection is opened, and match them up with closes (hopefully) later
    on in the application.
    Other than that, log4j debug statements in the code will help you
    track what connections are in use and find when there's one that's
    opened but never closes.

    Pete Bennett
    Distributed Systems Professional Services.


    On Jun 23, 4:04*pm, oms...@gmail.com wrote:
    > Hi,
    >
    > We have a long running asynchronous bean (say B1) starting out of a Servlet init. This bean sleeps(using Thread.sleep) and wakes up every few minutes and checks
    > for existence of a record in the database. If record exists, then it invokes a process (say P) that can run one hour or more.
    > During processing, P opens numerous database connections following Open-Use-Close policy. *The process (P) *can also be run through
    > Servlet GET request (say G) by a user as needed. Database connections used by P belong to multiple datasources.
    >
    > When P is invoked through Servlet GET request (G) everything works fine.
    > But when P is invoked through a long running Async Bean it leaves a hanging thread in DB2 database.
    > Thread sits there as long as Async Bean is running (till server restart).
    >
    > I have spend quite a time to resolve this issue and I have made little progress.
    > If you know the reason or solution please share your knowledge.
    >
    > We are running DB2 version 9 on MVS, *WAS version 6.1.0.21 on Linux.
    > My min connections are 0. Connection timeout is 300 secs. Agetimeout is 1200.
    >
    > Thanks for your help.



  3. Re: Long running Asynchronous bean causing hanging threads in DB2

    This technote may help:

    Title: Disabling AIO (Asynchronous Input/Output) in WebSphere Application Server
    http://www.IBM.com/support/docview.w...id=swg21366862

  4. Re: Long running Asynchronous bean causing hanging threads in DB2

    Is your asychronous bean a Simple java object or an EJB?

  5. Re: Long running Asynchronous bean causing hanging threads in DB2

    It is a simple class started from Servlet init.

+ Reply to Thread