Translating with DrWatson… this can take a few seconds the first time.
This is a genuine, complex translation. DrWatson protects commands, error codes, and log output while naturally translating the surrounding text. It’s translated once and saved.
Amit Patel asked why onmode -z on a session found via onstat -g stm sometimes fails to kill it. Eric Vercelletto said it may be rolling back a large transaction; check onstat -g tpf. Mike Walker added to check flags with onstat -g ses (R in 3rd position is rollback; track with onstat -x), noting hung or defunct sessions may need a restart. Paul Watson suggested checking the stack.
Auto-generated by Claude from the posts below — may be imperfect; read the full thread.
AMIT PATEL — source: IBM Community (ConnectedCommunity.org) Informix forum
Dears,
Kindly let me know if I run
onstat - g stm
command to check current sql statement which give the Session ID but sometimes if I try to kill the session by
onmode -z <id>, it doesn't kill the session. So do I need to connect the session id with onstat -k session id ?
kindly suggest.
Thanks
Amit Patel
------------------------------
AMIT PATEL
------------------------------
#Informix
↪ replying to AMIT PATEL
Eric Vercelletto — source: IBM Community (ConnectedCommunity.org) Informix forum
Hi AMit
Killing the session may take some(and sometimes a lot) of time because what it does is rollback the transaction. If the transaction is "intensive", i.e lots of SQL statements, it can really take long.
You can check what this session does with onstat -g tpf and look at the 'isrb' column and the 'is*' columns in general
↪ replying to AMIT PATEL
Mike Walker — source: IBM Community (ConnectedCommunity.org) Informix forum
Amit - sometimes a session can't be killed. It can get itself into a state where it is simply hung. This doesn't happen often, but it can.
I doubt that it's a locking issue which is preventing the termination of the session (which is what you would be looking at with onstat -k), although you can check on the locks held this way, and see if locks are being released.
You should look at the session with onstat -g ses <session id>, and check the flags and the thread status. If this is a long rollback (as Eric suggested, and which is most likely), then you will see an "R" in the 3rd position of the flags, and you can track progress of the rollback with onstat -x and compare the beginning log position of the transaction with the current log position.
I have run into some bugs before with mutexes, which have prevented a session from being killed. In this case the 1st position of the flags showed an "S", and they only solution was to restart Informix. If something unusual has happened, like an assert failure, the session may be shown as "defunct" and, again, there's not much you can do.
Mike
------------------------------
Mike Walker
------------------------------
↪ replying to Mike Walker
Paul Watson — source: IBM Community (ConnectedCommunity.org) Informix forum
Look at the stack – that can sometimes help as to why you have an unkill'able session
Cheers
Paul
We use strictly necessary cookies to make this site work. With your
consent we’d also use optional cookies for analytics and marketing. You can accept all,
reject all, or choose. Read our Cookie Policy.