MMatchPO.create leaves database transaction open when matching fails

Description

When a MatchPO fails, normally with a message like

Total matched invoiced qty > ordered qty. MatchedInvoicedQty=6.0, OrderedQty=5, Line=MOrderLine[1008394, Line=20, Ordered=5, Delivered=0, Invoiced=1, Reserved=5, LineNet=64.40]

the transaction isn't rolled back but is left hanging. This means that all involved tables can't be updated and the whole system hangs after a while.

Now I regularly kill the idle transactions to solve the problem. The problem occurs when the Matching PO-Receipt-Invoice form is used.

Environment

None

Activity

Show:

Daniel Tamm January 27, 2016 at 8:48 PM

OK. I'll try slightly smiling face Before I changed my code it happened all the time on two different clients.

Carlos Ruiz January 27, 2016 at 8:16 PM

I checked and those lines are also on 2.1 - integrated by with ticket https://idempiere.atlassian.net/browse/IDEMPIERE-1665#icft=IDEMPIERE-1665

Maybe try to reproduce following same steps and if reproducible please post how to do it.

Daniel Tamm January 27, 2016 at 7:35 PM

I never checked version 3.x. Did you try on 2.x? Perhaps it's fixed in 3.x? I'm running some 2.x versions and the patch is for 2.x. slightly smiling face

Carlos Ruiz January 27, 2016 at 3:19 PM

Hi , I was not able to reproduce the issue - in my tests the exception is captured on

Match.cmd_process:216

try{ if (createMatchRecord(invoice, M_InOutLine_ID, Line_ID, BigDecimal.valueOf(qty), innerTrxName)) innerTrx.commit(); else innerTrx.rollback(); }catch(Exception ex){ innerTrx.rollback(); throw new AdempiereException(ex); }finally{ innerTrx.close(); innerTrx = null; }

rolled back and closed.

Regards,

Carlos Ruiz

Cannot Reproduce

Details

Assignee

Reporter

Labels

Components

Affects versions

Priority

Created January 26, 2016 at 3:43 PM
Updated February 29, 2016 at 10:11 PM
Resolved January 27, 2016 at 3:26 PM