IDEMPIERE-4346 [Allocation Reset] - Don't close trx when exception is throw (#2059)

This commit is contained in:
Carlos Ruiz 2023-10-17 03:42:26 +02:00 committed by GitHub
parent 384120e0d8
commit 74e8226ab0
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 10 additions and 7 deletions

View File

@ -111,12 +111,15 @@ public class AllocationReset extends SvrProcess
if (p_C_AllocationHdr_ID != 0)
{
try {
MAllocationHdr hdr = new MAllocationHdr(getCtx(), p_C_AllocationHdr_ID, m_trx.getTrxName());
if (delete(hdr))
count++;
else
throw new AdempiereException("Cannot delete");
} finally {
m_trx.close();
}
StringBuilder msgreturn = new StringBuilder("@Deleted@ #").append(count);
return msgreturn.toString();
}
@ -176,8 +179,8 @@ public class AllocationReset extends SvrProcess
{
DB.close(rs, pstmt);
rs = null; pstmt = null;
}
m_trx.close();
}
StringBuilder msgreturn = new StringBuilder("@Deleted@ #").append(count);
return msgreturn.toString();
} // doIt