IDEMPIERE-5754 - Check PInstance_ID before Process Lock DB Update, PInstance 0 on createPricelist (#1874)
* IDEMPIERE-5754 - Check PInstance_ID before Process Lock DB Update, PInstance 0 on createPricelist * IDEMPIERE-5754 - improve AD_PInstance_ID check on SvrProcess unlock * IDEMPIERE-5754 - revert legacy check
This commit is contained in:
parent
4b445e3107
commit
f832d496e3
|
@ -703,8 +703,9 @@ public abstract class SvrProcess implements ProcessCall
|
||||||
if (log.isLoggable(Level.FINE)) log.fine("AD_PInstance_ID=" + m_pi.getAD_PInstance_ID());
|
if (log.isLoggable(Level.FINE)) log.fine("AD_PInstance_ID=" + m_pi.getAD_PInstance_ID());
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
DB.executeUpdate("UPDATE AD_PInstance SET IsProcessing='Y' WHERE AD_PInstance_ID="
|
if(m_pi.getAD_PInstance_ID() > 0) // Update only when AD_PInstance_ID > 0 (When we Start Process w/o saving process instance (No Process Audit))
|
||||||
+ m_pi.getAD_PInstance_ID(), null); // outside trx
|
DB.executeUpdate("UPDATE AD_PInstance SET IsProcessing='Y' WHERE AD_PInstance_ID="
|
||||||
|
+ m_pi.getAD_PInstance_ID(), null); // outside trx
|
||||||
} catch (Exception e)
|
} catch (Exception e)
|
||||||
{
|
{
|
||||||
log.severe("lock() - " + e.getLocalizedMessage());
|
log.severe("lock() - " + e.getLocalizedMessage());
|
||||||
|
@ -728,19 +729,21 @@ public abstract class SvrProcess implements ProcessCall
|
||||||
if (Thread.currentThread().isInterrupted())
|
if (Thread.currentThread().isInterrupted())
|
||||||
Thread.interrupted();
|
Thread.interrupted();
|
||||||
|
|
||||||
MPInstance mpi = new MPInstance (getCtx(), m_pi.getAD_PInstance_ID(), null);
|
if(m_pi.getAD_PInstance_ID() > 0) {
|
||||||
if (mpi.get_ID() == 0)
|
MPInstance mpi = new MPInstance (getCtx(), m_pi.getAD_PInstance_ID(), null);
|
||||||
{
|
if (mpi.get_ID() == 0)
|
||||||
log.log(Level.SEVERE, "Did not find PInstance " + m_pi.getAD_PInstance_ID());
|
{
|
||||||
return;
|
log.log(Level.INFO, "Did not find PInstance " + m_pi.getAD_PInstance_ID());
|
||||||
}
|
return;
|
||||||
mpi.setIsProcessing(false);
|
}
|
||||||
mpi.setResult(!m_pi.isError());
|
mpi.setIsProcessing(false);
|
||||||
mpi.setErrorMsg(m_pi.getSummary());
|
mpi.setResult(!m_pi.isError());
|
||||||
mpi.saveEx();
|
mpi.setErrorMsg(m_pi.getSummary());
|
||||||
if (log.isLoggable(Level.FINE)) log.fine(mpi.toString());
|
mpi.saveEx();
|
||||||
|
if (log.isLoggable(Level.FINE)) log.fine(mpi.toString());
|
||||||
|
|
||||||
ProcessInfoUtil.saveLogToDB(m_pi);
|
ProcessInfoUtil.saveLogToDB(m_pi);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
catch (Exception e)
|
catch (Exception e)
|
||||||
{
|
{
|
||||||
|
|
Loading…
Reference in New Issue