IDEMPIERE-525 Launching the same process throwing errors on console
This commit is contained in:
parent
4d15a4515e
commit
fd433c7313
|
@ -219,13 +219,16 @@ public final class ProcessUtil {
|
|||
{
|
||||
pi.setSummary (Msg.getMsg(Env.getCtx(), "ProcessError") + " " + e.getLocalizedMessage(), true);
|
||||
log.log(Level.SEVERE, pi.getClassName(), e);
|
||||
success = false;
|
||||
return false;
|
||||
}
|
||||
finally
|
||||
{
|
||||
if (trx != null && managedTrx)
|
||||
{
|
||||
trx.rollback();
|
||||
if (!success) {
|
||||
trx.rollback();
|
||||
}
|
||||
trx.close();
|
||||
trx = null;
|
||||
}
|
||||
|
|
|
@ -304,9 +304,9 @@ public class MPInstance extends X_AD_PInstance
|
|||
int seconds = (int)(ms / 1000);
|
||||
if (seconds < 1)
|
||||
seconds = 1;
|
||||
MProcess prc = MProcess.get(getCtx(), getAD_Process_ID());
|
||||
prc.addStatistics(seconds);
|
||||
if (prc.get_ID() != 0 && prc.save())
|
||||
String updsql = "UPDATE AD_Process SET Statistic_Count=Statistic_Count+1, Statistic_Seconds=Statistic_Seconds+? WHERE AD_Process_ID=?";
|
||||
int no = DB.executeUpdate(updsql, new Object[] {seconds, getAD_Process_ID()}, true, null); // out of trx
|
||||
if (no == 1)
|
||||
log.fine("afterSave - Process Statistics updated Sec=" + seconds);
|
||||
else
|
||||
log.warning("afterSave - Process Statistics not updated");
|
||||
|
|
|
@ -341,6 +341,7 @@ public class MProcess extends X_AD_Process
|
|||
/**
|
||||
* Update Statistics
|
||||
* @param seconds sec
|
||||
* @deprecated - use UPDATE instead
|
||||
*/
|
||||
public void addStatistics (int seconds)
|
||||
{
|
||||
|
|
Loading…
Reference in New Issue