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); pi.setSummary (Msg.getMsg(Env.getCtx(), "ProcessError") + " " + e.getLocalizedMessage(), true);
log.log(Level.SEVERE, pi.getClassName(), e); log.log(Level.SEVERE, pi.getClassName(), e);
success = false;
return false; return false;
} }
finally finally
{ {
if (trx != null && managedTrx) if (trx != null && managedTrx)
{ {
if (!success) {
trx.rollback(); trx.rollback();
}
trx.close(); trx.close();
trx = null; trx = null;
} }

View File

@ -304,9 +304,9 @@ public class MPInstance extends X_AD_PInstance
int seconds = (int)(ms / 1000); int seconds = (int)(ms / 1000);
if (seconds < 1) if (seconds < 1)
seconds = 1; seconds = 1;
MProcess prc = MProcess.get(getCtx(), getAD_Process_ID()); String updsql = "UPDATE AD_Process SET Statistic_Count=Statistic_Count+1, Statistic_Seconds=Statistic_Seconds+? WHERE AD_Process_ID=?";
prc.addStatistics(seconds); int no = DB.executeUpdate(updsql, new Object[] {seconds, getAD_Process_ID()}, true, null); // out of trx
if (prc.get_ID() != 0 && prc.save()) if (no == 1)
log.fine("afterSave - Process Statistics updated Sec=" + seconds); log.fine("afterSave - Process Statistics updated Sec=" + seconds);
else else
log.warning("afterSave - Process Statistics not updated"); log.warning("afterSave - Process Statistics not updated");

View File

@ -341,6 +341,7 @@ public class MProcess extends X_AD_Process
/** /**
* Update Statistics * Update Statistics
* @param seconds sec * @param seconds sec
* @deprecated - use UPDATE instead
*/ */
public void addStatistics (int seconds) public void addStatistics (int seconds)
{ {