There is no way to stop a running process. That can be changed if we change code of the processes but that is not easy to do everywhere. Up to now we have no interface and no user interface for that
both topics are similar.
norbertbede3, the problem with stopping a slow process is that you can stop the thread but the query in the DB keeps running until it finishes
norbertbede2 left the room (quit: Ping timeout: 240 seconds).
any idea how to resolve this ?
can't one kill db processes as well
I know it is possible to kill a db process, but I'm not sure if the db process is associated with the java process in iDempiere right now. If you know which db process to stop, it is possible.
any epochal idea here ? any others ?
thinking in draft
could be something like
when running the JDBC query we associate it to AbstractProcessCtl
and when interrupting the AbstractProcessCtl thread - check first if there are associated JDBC and send a cancel query to the backend
in postgresql there is a function pg_cancel_backend - requires the PID of the process running the query
in oracle I don't know
now - on JDBC there is a Statement.cancel() - I haven't tested that to see if is inline with our request
which adds a long delay in Recalculate Cube for testing purposes.
Uploaded patch adapted to 6.2
In this patch I'm exploring the possibility to interrupt the SQL running query in postgresql.
However, it works when the class is interrupted in the sleep, but it's not working when the class is interrupted in the PreparedStatement
The interrupt on the WProcessCtl/AbstractProcessCtl thread is not propagating to the query running.
Since there’s no reliable way to stop/interrupt a Java thread/process, this needs to be implemented in a cooperative way. We need to add a set of new process control interface (ProcessCall, SvrProcess or perhaps a new interface) and process that can be stop/interrupt needs to implement the new interfaces. A new UI and/or server monitor method mechanism should be build for processes that implements the new control interface.