From 7eb915047a3baa0f986dd01c16ad826505800c5d Mon Sep 17 00:00:00 2001 From: Carlos Ruiz Date: Tue, 29 Jul 2008 07:07:14 +0000 Subject: [PATCH] Integrate Trifon's change from trunk revision 5795 BugFix: [ 1939524 ] Bad context for cache of po objects on server https://sourceforge.net/tracker/index.php?func=detail&aid=1939524&group_id=176962&atid=879332 --- base/src/org/compiere/model/MTable.java | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/base/src/org/compiere/model/MTable.java b/base/src/org/compiere/model/MTable.java index b90d63760c..343de05db9 100644 --- a/base/src/org/compiere/model/MTable.java +++ b/base/src/org/compiere/model/MTable.java @@ -52,11 +52,13 @@ public class MTable extends X_AD_Table { Integer key = new Integer (AD_Table_ID); MTable retValue = (MTable) s_cache.get (key); - if (retValue != null) + if (retValue != null && retValue.getCtx() == ctx) { return retValue; + } retValue = new MTable (ctx, AD_Table_ID, null); - if (retValue.get_ID () != 0) + if (retValue.get_ID () != 0) { s_cache.put (key, retValue); + } return retValue; } // get @@ -74,9 +76,13 @@ public class MTable extends X_AD_Table while (it.hasNext()) { MTable retValue = (MTable)it.next(); - if (tableName.equalsIgnoreCase(retValue.getTableName())) + if (tableName.equalsIgnoreCase(retValue.getTableName()) + && retValue.getCtx() == ctx + ) + { return retValue; } + } // MTable retValue = null; String sql = "SELECT * FROM AD_Table WHERE UPPER(TableName)=?";