application_handle reuse? LUW v10.5FP8

Rui Chen

application_handle reuse? LUW v10.5FP8

Hi DB2-experts, 

Have a question on application_handle reuse. When we join from different monitoring table functions/admin views using application_handle, eg. from MON_GET_APPL_LOCKWAIT / MON_LOCKWAIT to MON_GET_CONNECTION, is there any guarantee that application_handle returned by both sides are actually tied to the same TX? Is it possible that the application_handle is reused, and MON_LOCKWAIT and MON_GET_CONNECTION return metrics from different TXs sharing the same application_handle?

A little bit background, we use jdbc connectionPool and pass application metadata, eg. client_userid, which is returned by MON_GET_CONNECTION; we also monitor lockwait regularly. We recently encountered a puzzle where  MON_LOCKWAIT says one TX spent over 100sec on lockwait, but the client_userid points us to a TX that completed super fast. Of course it's possible that we have a bug passing wrong value to client_userid, but just want to make sure DB2 doesn't introduce any extra confusion. 

Thanks for your input. 

Edited By:
Rui Chen[Organization Members] @ Feb 27, 2018 - 02:54 PM (America/Eastern)

Mark Barinstein

RE: application_handle reuse? LUW v10.5FP8
(in response to Rui Chen)


There is no such a guaranty especially in case of very quick transactions.
The preferred way to monitor lock waits / timeouts is to create an event monitor for locking and configure your database to catch the desired events and amount of information to it.

Edited By:
Mark Barinstein[Organization Members] @ Feb 28, 2018 - 12:28 PM (Europe/Moscow)