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
This commit is contained in:
Carlos Ruiz 2008-07-29 07:07:14 +00:00
parent 5c4d6def6f
commit 7eb915047a
1 changed files with 9 additions and 3 deletions

View File

@ -52,11 +52,13 @@ public class MTable extends X_AD_Table
{ {
Integer key = new Integer (AD_Table_ID); Integer key = new Integer (AD_Table_ID);
MTable retValue = (MTable) s_cache.get (key); MTable retValue = (MTable) s_cache.get (key);
if (retValue != null) if (retValue != null && retValue.getCtx() == ctx) {
return retValue; return retValue;
}
retValue = new MTable (ctx, AD_Table_ID, null); retValue = new MTable (ctx, AD_Table_ID, null);
if (retValue.get_ID () != 0) if (retValue.get_ID () != 0) {
s_cache.put (key, retValue); s_cache.put (key, retValue);
}
return retValue; return retValue;
} // get } // get
@ -74,9 +76,13 @@ public class MTable extends X_AD_Table
while (it.hasNext()) while (it.hasNext())
{ {
MTable retValue = (MTable)it.next(); MTable retValue = (MTable)it.next();
if (tableName.equalsIgnoreCase(retValue.getTableName())) if (tableName.equalsIgnoreCase(retValue.getTableName())
&& retValue.getCtx() == ctx
)
{
return retValue; return retValue;
} }
}
// //
MTable retValue = null; MTable retValue = null;
String sql = "SELECT * FROM AD_Table WHERE UPPER(TableName)=?"; String sql = "SELECT * FROM AD_Table WHERE UPPER(TableName)=?";