From 476c98a4b4f5b20faf3d8a6cf03a1658d66d6f4a Mon Sep 17 00:00:00 2001 From: Heng Sin Low Date: Tue, 19 Aug 2014 17:16:19 +0800 Subject: [PATCH] IDEMPIERE-3653 1004207 Change behavior of system cacheing for multi-tenants. Use distributed cache for model. --- org.adempiere.base/src/org/compiere/model/MAcctSchema.java | 7 ++++--- org.adempiere.base/src/org/compiere/model/MClient.java | 2 +- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/org.adempiere.base/src/org/compiere/model/MAcctSchema.java b/org.adempiere.base/src/org/compiere/model/MAcctSchema.java index 1ebe499c42..495bf66133 100644 --- a/org.adempiere.base/src/org/compiere/model/MAcctSchema.java +++ b/org.adempiere.base/src/org/compiere/model/MAcctSchema.java @@ -131,14 +131,15 @@ public class MAcctSchema extends X_C_AcctSchema // Save MAcctSchema[] retValue = new MAcctSchema [list.size()]; list.toArray(retValue); - s_schema.put(key, retValue); + if (trxName == null) + s_schema.put(key, retValue); return retValue; } // getClientAcctSchema /** Cache of Client AcctSchema Arrays **/ - private static CCache s_schema = new CCache(I_AD_ClientInfo.Table_Name, 3); // 3 clients + private static CCache s_schema = new CCache(I_AD_ClientInfo.Table_Name, 3, 120, true); // 3 clients /** Cache of AcctSchemas **/ - private static CCache s_cache = new CCache(Table_Name, 3); // 3 accounting schemas + private static CCache s_cache = new CCache(Table_Name, 3, 120, true); // 3 accounting schemas /************************************************************************** diff --git a/org.adempiere.base/src/org/compiere/model/MClient.java b/org.adempiere.base/src/org/compiere/model/MClient.java index 10ec27a6e4..bffae62645 100644 --- a/org.adempiere.base/src/org/compiere/model/MClient.java +++ b/org.adempiere.base/src/org/compiere/model/MClient.java @@ -118,7 +118,7 @@ public class MClient extends X_AD_Client @SuppressWarnings("unused") private static CLogger s_log = CLogger.getCLogger (MClient.class); /** Cache */ - private static CCache s_cache = new CCache(Table_Name, 3); + private static CCache s_cache = new CCache(Table_Name, 3, 120, true); /**************************************************************************