How to terminate a process without rollback
Hi Community,
When we terminate a process that is in a transaction, the system (fortunately) performs a rollback.
As part of some troubleshooting, I'm wondering if there's a way around this behavior to avoid rollback (or force commit) before termination.
Recently we had an issue on a test server with a process stuck in a huge transaction (around 100GB).
The out-of-control process was suspended and then terminated causing a rollback.
In the case of a test server, this is not really a problem.
If it happens on a production system, depending on the situation we might prefer to avoid rollback (journal volume, server availability, performance...).
We can suspend the process to save time, but then how to terminate it and avoid the rollback.
Although not recommended for obvious reasons, Is it possible?
Thank you.
It is rather brute force but matches your decision to skip rollbacks:
to be sure to catch all cases I'd place it in a %ZSTOP.mac
It's the reverse of %ZSTART. >> docu
Hi @Robert Cemper !
Good Idea!
I tested, but unfortunately, It seems already too late, the rollback is already performed.
%ZSTOP routine
Even if the process is in a transaction before "terminate", the
^zJob
trace records a $TLEVEL with the value 0.Maybe it's just not possible (or possible with a not documented procedure).
Thank you.
You are right.
But it works in a test within a Try-Catch bloxk
This may be useful to you:
Hi @Robert Cemper, @Vitaliy.Serdtsev
Thank you for your replies!
I found a solution to do this without any change to an existing code, not simple but It works and could be useful in a critical situation.
I read the code of
^%ETN
and see these lines :So, If we create a "%ZERROR" routine, we have an entry point :
And then, we must terminate the process like that:
It's important to use the
SYS.Process
class and theTerminate
method with argument1
to use^%ETN
.GREAT !
without touching the code
Social networks
InterSystems resources
Log in or sign up
Log in or create a new account to continue
Log in or sign up
Log in or create a new account to continue
Log in or sign up
Log in or create a new account to continue