Search code examples
javalinuxdatabasedb2db2-luw

DB2 query seems to hang


our platform is:

DB2 ESE 10.5.8 running on IBM Power Linux Power 7 with Red Hat RHEL 6.9 (Santiago)

The issue is: Sometimes certain requests get kind of "hung" because they don't seem to do anything yet they are still connected for hours (if not forced before) and don't release the thread which causes batch jobs to never finish until these requests are forced off.

There are NO locks of any kind (lock timeouts or deadlocks).

db2top locks screen

db2top application details

These pictures show a complex query probably coming from a dbvisualizer but sometimes the query is just a "Select current schema from sysdummy1;" and yet never finishes.

Applications connecting to the database are Websphere Application Server (WAS) 8.5 and dbvis (dbvisualizer). Issue happens on both but more often with dbvis.

The application is in uow waiting state, that is, it should be waiting for work once previous work was completed. On the other hand, I have not explained how such connections cause batch-jobs to never finish because that is exactly what I don't know and wish to know.

In other words: an "UOW Waiting" state application doing currently nothing but waiting shows an unfinished query running, which is a paradox.

Here you can see also UOW completion status is Committed, which I understand this app-handle has no commit-pendings pending.

Application Snapshot
Application handle                         = 47954
Application status                         = UOW Waiting
Status change time                         = 10/29/2018 09:40:02.391805
Application code page                      = 1208
Application country/region code            = 0
Application name                           = dbvis
Connection request start timestamp         = 10/29/2018 09:38:33.022561
Connect request completion timestamp       = 10/29/2018 09:38:33.023248
Application idle time                      = 6 minutes 14 seconds
Previous UOW completion timestamp          = 10/29/2018 09:40:02.079211
Elapsed time of last completed uow (sec.ms)= 0.001282
UOW start timestamp                        = 10/29/2018 09:40:02.390511
UOW stop timestamp                         = 10/29/2018 09:40:02.391793
UOW completion status                      = Committed - Commit Statement
Workspace Information
Most recent operation                      = Static Commit
Most recent operation start timestamp      = 10/29/2018 09:40:02.391735
Most recent operation stop timestamp       = 10/29/2018 09:40:02.391793
Statement type                             = Static SQL Statement
Statement                                  = Static Commit
Statement start timestamp                  = 10/29/2018 09:40:02.391735
Statement stop timestamp                   = 10/29/2018 09:40:02.391793
Blocking cursor                            = NO

Statement type                             = Dynamic SQL Statement
Statement                                  = Fetch
Section number                             = 163
Cursor name                                = COL_DYNH
Statement start timestamp                  = 10/29/2018 09:39:57.544068
Statement stop timestamp                   = 10/29/2018 09:39:57.545429
Blocking cursor                            = YES

Solution

  • Is dbvis in auto-commit mode?

    https://www.ibm.com/developerworks/community/blogs/IMSupport/entry/In_DB2LUW_why_a_session_with_status_UOW_Waiting_holding_locks_and_log_space?lang=en