Message Boards
get userid from pts id (in order to kill locked session)?
Irfan Jamal, modified 3 Years ago.
get userid from pts id (in order to kill locked session)?
Post Date: 5/16/19 (Bronze, 11 Posts) Recent PostsWe're using EE 2017 (cloud) and sometimes have users that end up locking tables due to a hung session (or lost connection). We only find out when another user gets the message "...locked by pts/XX".
Running "who" from OS level gives us the user pts link, but it's the OS user, which, in the cloud, is usually one of 2 default OS ids (*qond).
Is there any way to determine which APPLICATION user id matches a pts #?
From there, the plan is to get the session id and use Session Maintenance to Delete the session.
If there is a simpler way to accomplish this, please let me know.
Thanks
Phill Norrey, modified 7 Years ago.
Re: get userid from pts id (in order to kill locked session)?
Post Date: 5/20/19 (Yoda, 1010 Posts) Recent PostsIrfan Jamal, modified 7 Years ago.
Re: get userid from pts id (in order to kill locked session)?
Post Date: 5/20/19 (Bronze, 11 Posts) Recent PostsHi Phill,
Thanks for the reply. I have a few minor issues with the screen (in EE 2017 it only displays 8 chars of the users session id) but more importantly, it doesn't link to a PTS # (which is what we get when the lock occurs).
I did notice that there is a login time, and I guess we could use some combination of login time and program to try and figure out which session it is. I was just hoping there was an easier way (like if this table contained pts # :P).
Thanks,
I Jamal
Tomaz Ranzinger, modified 7 Years ago.
Re: get userid from pts id (in order to kill locked session)?
Post Date: 5/26/19 (Silver, 77 Posts) Recent PostsYou can create simple browse from tables mon_mstr and _Connect (key is mon__qad01 = _Connect_Usr). In field _Connect-Device you will get pts number for user session. In field mon_userid is user ID and in field mon_program you will find which program runs user.
Add also filter _Connect-Device <> 'batch' to prevent display all batch sessions.
Irfan Jamal, modified 7 Years ago.
Re: get userid from pts id (in order to kill locked session)?
Post Date: 5/26/19 (Bronze, 11 Posts) Recent PostsThanks Tomaz. That helped quite a bit. For EE 2017 the fields are slightly different, but I was able to figure it out using the info you provided. For anyone who finds this through seaching, the field in mon_mstr is now mon__qadi01 in EE 2017. _Connect-Device contains the pts #.
FOR EACH mon_mstr NO-LOCK,
FIRST _Connect NO-LOCK
WHERE _Connect._Connect-Usr = mon__qadi01
AND _Connect._Connect-Device <> 'batch':
DISPLAY mon__qadi01 mon_userid _Connect._Connect-Device.
END.
Message place holder
Forums