IDEMPIERE-5874 - adding AD_Client_ID to MDistribution cache key (#2040)

* IDEMPIERE-5874 - adding AD_Client_ID to MDistribution cache key

* IDEMPIERE-5874 - applying deprecation patch
This commit is contained in:
matheus-marcelinux 2023-11-03 16:40:56 -03:00 committed by GitHub
parent b2e863fd0f
commit e3cab6c238
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 5 additions and 3 deletions

View File

@ -201,11 +201,13 @@ public class MDistribution extends X_GL_Distribution
* Get Distributions for Account * Get Distributions for Account
* @param Account_ID id * @param Account_ID id
* @return array of distributions * @return array of distributions
* @deprecated - using the method to get a specific account ID doesn't make sense because of the flag IsAnyAcct
* use method getAll() instead
*/ */
public static MDistribution[] get (int Account_ID) public static MDistribution[] get (int Account_ID)
{ {
Properties ctx = Env.getCtx(); Properties ctx = Env.getCtx();
Integer key = Integer.valueOf(Account_ID); String key = Env.getAD_Client_ID(ctx) + "_" + Account_ID;
MDistribution[] retValue = (MDistribution[])s_accounts.get(key); MDistribution[] retValue = (MDistribution[])s_accounts.get(key);
if (retValue != null) if (retValue != null)
return retValue; return retValue;
@ -251,8 +253,8 @@ public class MDistribution extends X_GL_Distribution
@SuppressWarnings("unused") @SuppressWarnings("unused")
private static CLogger s_log = CLogger.getCLogger (MDistribution.class); private static CLogger s_log = CLogger.getCLogger (MDistribution.class);
/** Distributions by Account */ /** Distributions by Account */
private static CCache<Integer,MDistribution[]> s_accounts private static CCache<String,MDistribution[]> s_accounts
= new CCache<Integer,MDistribution[]>(Table_Name, 100); = new CCache<String,MDistribution[]>(Table_Name, 100);
/** /**