IBM MQ Little Gem #19: DISPLAY CONN dates & times

By Morag Hughson posted 01-18-2017 19:41

  
This is part of a series of small blog posts which will cover some of the smaller, perhaps less likely to be noticed, features of IBM MQ. Read other posts in this series.

UOWSTDA.jpgI learned something new the other day, and thought I would share it with you in case any of you weren't aware of it either. It certainly comes into the category of small MQ features that you may not have noticed!

MQ has a command DISPLAY CONN which allows you to see information about an application connection, including various fields about the Unit of Work that connection may have created. One of the reasons this command was created was to enable an administrator of a queue manager to discover which application(s) has a long running Unit of Work.

So what command should I issue to discover the applications that might be responsible for long-running Units of Work? You might imagine, as I did, that one of the following might do it.

DISPLAY CONN(*) ALL WHERE(UOWSTATE EQ ACTIVE)
DISPLAY CONN(*) ALL WHERE(UOWSTDA NE ' ')
DISPLAY CONN(*) ALL WHERE(UOWSTTI NE ' ')
DISPLAY CONN(*) ALL WHERE(QMURID NE ' ')

These however will also show up applications (on the distributed platform queue managers) that have made an MQGET call that may result in a Unit of Work being started, even if it didn't actually start a Unit of Work. For example, an MQGET call that used the MQGMO_SYNCPOINT option (or even the MQGMO_SYNCPOINT_IF_PERSISTENT option) but didn't receive any message and completed with a return code of MQRC_NO_MSG_AVAILABLE, will still show up in the above commands. It may have made that call minutes, hours or days ago, but it doesn't have a long-running Unit of Work open.

Instead, what you need to look for are those applications that have written to the log. One of the following commands will work.

DISPLAY CONN(*) ALL WHERE(UOWLOGDA NE ' ')
DISPLAY CONN(*) ALL WHERE(UOWLOGTI NE ' ')

Here's an example connection which made an MQGET call using MQGMO_SYNCPOINT at 14.20.10 but didn't actually process a message in that Unit of Work until 14.22.39.

AMQ8276: Display Connection details.
   CONN(80C95B5820039E01)                
   EXTCONN(414D51434D5147312020202020202020)
   TYPE(*)                               
   PID(8632)                            TID(1) 
   APPLDESC( )                          APPLTAG(D:\nttools\mqmonntp.exe)
   APPLTYPE(USER)                       ASTATE(NONE)
   CHANNEL( )                           CLIENTID( )
   CONNAME( )                           CONNOPTS(MQCNO_SHARED_BINDING)
   USERID(morag)                        UOWLOG(S0000000.LOG)
   UOWSTDA(2017-01-19)                  UOWSTTI(14.20.10)  
   UOWLOGDA(2017-01-19)                 UOWLOGTI(14.22.39) 
   URTYPE(QMGR)                         
   EXTURID(XA_FORMATID[] XA_GTRID[] XA_BQUAL[])
   QMURID(0.8194)                       UOWSTATE(ACTIVE)

   OBJNAME(Q1)                          OBJTYPE(QUEUE)
   ASTATE(NONE)                         HSTATE(INACTIVE)
   OPENOPTS(MQOO_INPUT_SHARED,MQOO_OUTPUT)
   READA(NO)                            

What I've written applies to the distributed platform queue managers, but not to z/OS. Perhaps that's why I never realised until now. On z/OS, UOWSTTI and UOWLOGTI appear to always be the same. There is no UOWSTATE(ACTIVE) until the log has been involved.

So, make sure you're not finding false positives when looking for long-running Units of Work. While the first set of commands above will work on z/OS, the second set of commands will work on all platforms.


Morag Hughson is an MQ expert. She spent 18 years in the MQ Devt organisation before taking on her current job writing MQ Technical education courses with MQGem. She also blogs for MQGem. You can connect with her here on IMWUC or on Twitter and LinkedIn.

#WebSphere
#gwc
#MQ
6 comments
9 views

Permalink

Comments

02-02-2018 01:17

Reply to Mangesh

Well I haven't written it yet!! :-)

The training is online on a web learning platform. Please contact us as noted in the webpage I mentioned before if you'd like to be signed up for any training.

Cheers,
Morag

02-01-2018 07:36

Reply Morag

Thanks. I am looking forward to attend the online traning on "MQ Transaction"

What is training location ? Its not mentioend in the mqgem uril

01-30-2018 15:36

Reply to Mangesh

I don't currently have any blog posts on MQ transactions.

Here is the page in Knowledge Center that describes MQ transactions.

Transaction management and support

I also create MQ training modules, and am now considering producing one as an introduction to MQ transactions. You can see the training modules I already have available at http://www.mqgem.com/training.html

01-30-2018 01:17

Very useful . Is there any topic which wxplain trasaction concepts in MQ?

Hi Morag,

 

This topic is very much usefful. I love your blogs becasue the neat and exact explaination with simple exaples.

I have heard and come across the term 'MQ trasaction' and read some articles . However its still not clear to me. Is there any blog/article you aready posted which explain 'MQ Trasaction concerpt ? Please ping the link here.

If not may I request you to please upload a blog which explain this concept. Please :)

01-23-2017 14:26

Reply Vinay

Yes indeed. It is a vary useful command

01-23-2017 11:12

MQ conn

Thanks, there are multiple ways we can use this command.