IDEMPIERE-4346 [Allocation Reset] - Don't close trx when exception is throw (#2059)
This commit is contained in:
parent
384120e0d8
commit
74e8226ab0
|
@ -111,12 +111,15 @@ public class AllocationReset extends SvrProcess
|
||||||
|
|
||||||
if (p_C_AllocationHdr_ID != 0)
|
if (p_C_AllocationHdr_ID != 0)
|
||||||
{
|
{
|
||||||
|
try {
|
||||||
MAllocationHdr hdr = new MAllocationHdr(getCtx(), p_C_AllocationHdr_ID, m_trx.getTrxName());
|
MAllocationHdr hdr = new MAllocationHdr(getCtx(), p_C_AllocationHdr_ID, m_trx.getTrxName());
|
||||||
if (delete(hdr))
|
if (delete(hdr))
|
||||||
count++;
|
count++;
|
||||||
else
|
else
|
||||||
throw new AdempiereException("Cannot delete");
|
throw new AdempiereException("Cannot delete");
|
||||||
|
} finally {
|
||||||
m_trx.close();
|
m_trx.close();
|
||||||
|
}
|
||||||
StringBuilder msgreturn = new StringBuilder("@Deleted@ #").append(count);
|
StringBuilder msgreturn = new StringBuilder("@Deleted@ #").append(count);
|
||||||
return msgreturn.toString();
|
return msgreturn.toString();
|
||||||
}
|
}
|
||||||
|
@ -176,8 +179,8 @@ public class AllocationReset extends SvrProcess
|
||||||
{
|
{
|
||||||
DB.close(rs, pstmt);
|
DB.close(rs, pstmt);
|
||||||
rs = null; pstmt = null;
|
rs = null; pstmt = null;
|
||||||
}
|
|
||||||
m_trx.close();
|
m_trx.close();
|
||||||
|
}
|
||||||
StringBuilder msgreturn = new StringBuilder("@Deleted@ #").append(count);
|
StringBuilder msgreturn = new StringBuilder("@Deleted@ #").append(count);
|
||||||
return msgreturn.toString();
|
return msgreturn.toString();
|
||||||
} // doIt
|
} // doIt
|
||||||
|
|
Loading…
Reference in New Issue