diff --git a/org.adempiere.ui/src/org/compiere/apps/form/Match.java b/org.adempiere.ui/src/org/compiere/apps/form/Match.java index fb97c4594b..0147048172 100644 --- a/org.adempiere.ui/src/org/compiere/apps/form/Match.java +++ b/org.adempiere.ui/src/org/compiere/apps/form/Match.java @@ -206,12 +206,19 @@ public class Match // Create it String innerTrxName = Trx.createTrxName("Match"); Trx innerTrx = Trx.get(innerTrxName, true); - if (createMatchRecord(invoice, M_InOutLine_ID, Line_ID, BigDecimal.valueOf(qty), innerTrxName)) - innerTrx.commit(); - else + + try{ + if (createMatchRecord(invoice, M_InOutLine_ID, Line_ID, BigDecimal.valueOf(qty), innerTrxName)) + innerTrx.commit(); + else + innerTrx.rollback(); + }catch(Exception ex){ innerTrx.rollback(); - innerTrx.close(); - innerTrx = null; + throw new AdempiereException(ex); + }finally{ + innerTrx.close(); + innerTrx = null; + } } } // requery