From a39d4cfed53eb36b931fe8d0336e72479784fea6 Mon Sep 17 00:00:00 2001 From: Elaine Tan Date: Fri, 26 Apr 2013 18:30:35 +0800 Subject: [PATCH] IDEMPIERE-862 Create lines from MPS Lines function is not working - fix deadlock problem --- .../src/org/compiere/model/MPackage.java | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/org.adempiere.base/src/org/compiere/model/MPackage.java b/org.adempiere.base/src/org/compiere/model/MPackage.java index fb50e5a669..18076db9f7 100644 --- a/org.adempiere.base/src/org/compiere/model/MPackage.java +++ b/org.adempiere.base/src/org/compiere/model/MPackage.java @@ -319,7 +319,7 @@ public class MPackage extends X_M_Package if (line.getM_PackageMPS_ID() == 0) continue; - MPackageMPS packageMPS = new MPackageMPS(getCtx(), line.getM_PackageMPS_ID(), get_TrxName()); + MPackageMPS packageMPS = new MPackageMPS(getCtx(), line.getM_PackageMPS_ID(), null); packageMPS.setMasterTrackingNo(line.getMasterTrackingNo()); packageMPS.setTrackingNo(line.getTrackingNo()); packageMPS.setPrice(line.getPrice()); @@ -369,11 +369,13 @@ public class MPackage extends X_M_Package log.log(Level.SEVERE, "processOnline", e); setErrorMessage(Msg.getMsg(Env.getCtx(), "ShippingNotProcessed") + ": " + e.getMessage()); } - - if (trx != null) - { - trx.commit(); - trx.close(); + finally + { + if (trx != null) + { + trx.commit(); + trx.close(); + } } return ok;