Active transactions - kill from script

Sitrix
Tera Guru

Hello good people 🙂

 

TLDR; Pretty much what the title says. I'm assuming you can delete the record in the  "v_cluster_transaction" table, but would it be possible to query and kill certain transactions? I know you can do it from UI, but could it be done, e.g. in a scheduled job?

 

We have had some issues in the past with jobs running for a very long time, especially rest calls. I know you can limit this, either in the rest api or via timeouts in transaction quota rules. We consider

 

So far I haven't been able to find any utilities or functions that enables the transaction from background script, is it not possible?

1 ACCEPTED SOLUTION

Sitrix
Tera Guru

GlideTransactionManager.kill(current.session_id);

 

Found in the "kill" ui action.

View solution in original post

4 REPLIES 4

Community Alums
Not applicable

Hi @Sitrix ,

I have never used any scripts or scheduled jobs as such for killing the transactions .

The preference is always to this Blog : https://www.servicenowelite.com/blog/2016/11/4/viewing-and-killing-transactions

 

Thanks for the reply Sandeep 🙂

 

The idea was to automate it. I know theres a gui, but its of little use.

 

Edit: Also, it would be interesting to know the difference between killing and deleting a transaction. Are SN doing magic in the background when triggering via kill, or does it simply delete?

Community Alums
Not applicable

Hi @Sitrix ,

The approach i have shared is the recommended way of doing!!

https://docs.servicenow.com/en-US/bundle/tokyo-platform-administration/page/administer/platform-perf...

Killing would cancel the transaction and Deleting is not recommended!!

 

Sitrix
Tera Guru

GlideTransactionManager.kill(current.session_id);

 

Found in the "kill" ui action.