Professional Web Applications Themes

force application won't work, jdbc related - IBM DB2

Hi group, we frequently encounter the problem that if a JDBC based client application is forced to terminate (e.g. kill that client app), the corresponding db agent (db2 list applications) is still active and the "force application" command for that agent does not shut it down. This agent still holds locks and consumes CPU time, but we found no way to shut it down _safely_. We are using "com.ibm.db2.jcc.DB2Driver" as jdbc driver. The DB runs on an IBM PPC machine with AIX 5.1 Does anyone have an idea how to safely terminate the DB agent? Regards Jörg...

  1. #1

    Default force application won't work, jdbc related

    Hi group,

    we frequently encounter the problem that if a JDBC based client
    application is forced to terminate (e.g. kill that client app),
    the corresponding db agent (db2 list applications) is still active and
    the "force application" command for that agent does not shut it down.
    This agent still holds locks and consumes CPU time, but we found no way
    to shut it down _safely_.

    We are using "com.ibm.db2.jcc.DB2Driver" as jdbc driver.
    The DB runs on an IBM PPC machine with AIX 5.1

    Does anyone have an idea how to safely terminate the DB agent?

    Regards Jörg


    Jörg Guest

  2. #2

    Default Re: force application won't work, jdbc related

    Jörg,
    Do you know what the application is doing when the force app fails to
    stop it? The way force processing works, is that at certain points in
    engine processing (such as each time a row is read/index key read), the
    agent will check to see if it has been forced off. However, if the agent
    is (for example) running a trusted udf, that's in an infinite loop,
    there's nothing that can be done. If force application does not return
    relatively quickly, try using snapshots to see what the app is
    doing...it might be on a long running operation that isn't looking at
    the forced bit.


    Jörg Hähner wrote:
     

    Sean Guest

  3. #3

    Default Re: force application won't work, jdbc related

    Sean,
    thanks for answering.
    The application is importing larger amounts of data via JDBC into the DB
    while committing every 500 rows or so. So basically it sends only
    "insert" and "commit" to the Database. There are no UDFs involved. So we
    really did not implement anything on server-side. We just did the
    client app which imports the data. Then, after the client app is aborted
    (e.g. kill) the server-side part still hangs as described in previous
    part of this thread :-(

    Regards Jörg

    Sean McKeough wrote: 
    [...] [/ref]
    [...]

    Jörg Guest

  4. #4

    Default Re: force application won't work, jdbc related

    Ok, maybe I made a bad assumption in my first note...are you using 'db2
    force application' to force the app off the database, or you just kill
    off the client application? If the latter (ie you kill -9 the app) the
    agent won't know you did this until it tries to respond to the client
    (when it finishes whatever it's doing). To see what it's doing (long
    import?) you can use an application snapshot. The 'clean' way to force
    an application is using force...ctrl-c will send an interrupt to the
    agent; but if you just kill of the client process, there's no way to
    tell the agent what happened.

    Jörg Hähner wrote: 
    >
    > [...]
    > [/ref]
    > [...]
    >[/ref]

    Sean Guest

  5. #5

    Default Re: force application won't work, jdbc related


    Sean McKeough wrote: 
    It works fine if I force the application while the client application is
    running. The DB process sometimes hangs if the client application is
    killed first and I try to force the DB app afterwards.
    Correct me if I am wrong, but what happens if I interrupt the client
    application while it is in a transaction, it started the transaction but
    has neither sent commit nor rollback. The agent would wait for commit,
    rollback, or further statements and would never receive either one,
    right? So it would basically wait forever, since the client app does not
    exist any more and there is no need for the agent to respond.
    Do you think this could be our problem?

    Regards Jörg
     

    Jörg Guest

  6. #6

    Default Re: force application won't work, jdbc related

    The agent will continue to wait for the next request from the
    application when it's killed. How are you connected to the database
    (what os is the client/server, and what comms protocol). tcp/ip will
    timeout the socket eventually, not sure about how the agent detects
    death of the client for all comms layers we support...

    Jörg Hähner wrote: 
    >
    > It works fine if I force the application while the client application is
    > running. The DB process sometimes hangs if the client application is
    > killed first and I try to force the DB app afterwards.
    > Correct me if I am wrong, but what happens if I interrupt the client
    > application while it is in a transaction, it started the transaction but
    > has neither sent commit nor rollback. The agent would wait for commit,
    > rollback, or further statements and would never receive either one,
    > right? So it would basically wait forever, since the client app does not
    > exist any more and there is no need for the agent to respond.
    > Do you think this could be our problem?
    >
    > Regards Jörg

    >[/ref]

    Sean Guest

  7. #7

    Default Re: force application won't work, jdbc related

    PMJI ... if I am not mistaken, a KEEP_ALIVE TCP/IP parameter is often used at the TCP/IP comm layer to have the comm layer report to the DB2 agent that the communication session has terminated.

    --

    Bob
    Consulting I/T Specialist
    IBM Toronto Lab
    IBM Software Services for Data Management
    "Sean McKeough" <ca.ibm.com> wrote in message news:bmm9ev$btk$torolab.ibm.com...
    The agent will continue to wait for the next request from the
    application when it's killed. How are you connected to the database
    (what os is the client/server, and what comms protocol). tcp/ip will
    timeout the socket eventually, not sure about how the agent detects
    death of the client for all comms layers we support...

    Jörg Hähner wrote: 
    >
    > It works fine if I force the application while the client application is
    > running. The DB process sometimes hangs if the client application is
    > killed first and I try to force the DB app afterwards.
    > Correct me if I am wrong, but what happens if I interrupt the client
    > application while it is in a transaction, it started the transaction but
    > has neither sent commit nor rollback. The agent would wait for commit,
    > rollback, or further statements and would never receive either one,
    > right? So it would basically wait forever, since the client app does not
    > exist any more and there is no need for the agent to respond.
    > Do you think this could be our problem?
    >
    > Regards Jörg
    >  
    > [/ref]

    Bob Guest

  8. #8

    Default Re: force application won't work, jdbc related

    Sean McKeough wrote: 

    The application is running in JAVA using JDBC with the driver
    "com.ibm.db2.jcc.DB2Driver". The client machine is either running Win2k,
    AIX 5.1, or Solaris (SunOS 5.8). JDK in use is 1.4.2 on Sun and 1.3.1 on
    AIX and Windows. The DB Server (DB2 V8.1) runs on an IBM p630 with AIX 5.1

    Regards Jörg


    Jörg Guest

  9. #9

    Default Re: force application won't work, jdbc related

    I need to know what communication protocol is being used for the
    connection (check the db and node catalogs).

    Jörg Hähner wrote: 
    >
    >
    > The application is running in JAVA using JDBC with the driver
    > "com.ibm.db2.jcc.DB2Driver". The client machine is either running Win2k,
    > AIX 5.1, or Solaris (SunOS 5.8). JDK in use is 1.4.2 on Sun and 1.3.1 on
    > AIX and Windows. The DB Server (DB2 V8.1) runs on an IBM p630 with AIX 5.1
    >
    > Regards Jörg
    >
    >[/ref]

    Sean Guest

Similar Threads

  1. Run application in Flex 3 pro will not work
    By WarrenWalsh in forum Macromedia Flex General Discussion
    Replies: 3
    Last Post: May 10th, 06:52 AM
  2. Replies: 5
    Last Post: January 14th, 12:19 AM
  3. Application Panel and related features not available
    By FranklinIns in forum Coldfusion - Getting Started
    Replies: 0
    Last Post: September 23rd, 05:16 PM
  4. GetSavedLicenseKey doesn't work in an ASP.NET web application (HELP)
    By Gabriel in forum ASP.NET Building Controls
    Replies: 2
    Last Post: February 19th, 12:10 PM
  5. Replies: 1
    Last Post: August 28th, 08:14 AM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139