IDEMPIERE-525 Launching the same process throwing errors on console

This commit is contained in:
Carlos Ruiz 2012-12-05 00:30:48 -05:00
parent 4d15a4515e
commit fd433c7313
3 changed files with 8 additions and 4 deletions

View File

@ -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;
}

View File

@ -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");

View File

@ -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)
{