From 5b186ca8835267b15810db3f22935fedc55aff2a Mon Sep 17 00:00:00 2001 From: teo_sarca Date: Mon, 17 May 2010 15:08:56 +0000 Subject: [PATCH] BF [ 3002736 ] MLocation.get cache all MLocations Link to SF Tracker: http://sourceforge.net/support/tracker.php?aid=3002736 --- base/src/org/compiere/model/MLocation.java | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/base/src/org/compiere/model/MLocation.java b/base/src/org/compiere/model/MLocation.java index 026ba3f568..603ed2cb81 100644 --- a/base/src/org/compiere/model/MLocation.java +++ b/base/src/org/compiere/model/MLocation.java @@ -39,6 +39,10 @@ import org.compiere.util.Util; * @author Michael Judd (Akuna Ltd) *
  • BF [ 2695078 ] Country is not translated on invoice *
  • FR [2794312 ] Location AutoComplete - check if allow cities out of list + * + * @author Teo Sarca, teo.sarca@gmail.com + *
  • BF [ 3002736 ] MLocation.get cache all MLocations + * https://sourceforge.net/tracker/?func=detail&aid=3002736&group_id=176962&atid=879332 */ public class MLocation extends X_C_Location implements Comparator { @@ -62,13 +66,16 @@ public class MLocation extends X_C_Location implements Comparator return new MLocation(ctx, C_Location_ID, trxName); // Integer key = new Integer (C_Location_ID); - MLocation retValue = (MLocation) s_cache.get (key); + MLocation retValue = null; + if (trxName == null) + retValue = (MLocation) s_cache.get (key); if (retValue != null) return retValue; retValue = new MLocation (ctx, C_Location_ID, trxName); if (retValue.get_ID () != 0) // found { - s_cache.put (key, retValue); + if (trxName == null) + s_cache.put (key, retValue); return retValue; } return null; // not found