IDEMPIERE-5675 MTable.getPO cache for model factory wrongly removing from cache when PO is not found (#1788)
This commit is contained in:
parent
d0e6c050bd
commit
beed782d4e
|
@ -576,7 +576,6 @@ public class MTable extends X_AD_Table implements ImmutablePOSupport
|
||||||
{
|
{
|
||||||
if (po.get_ID() != Record_ID && Record_ID > 0)
|
if (po.get_ID() != Record_ID && Record_ID > 0)
|
||||||
po = null;
|
po = null;
|
||||||
else
|
|
||||||
return po;
|
return po;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -596,21 +595,19 @@ public class MTable extends X_AD_Table implements ImmutablePOSupport
|
||||||
{
|
{
|
||||||
if (po.get_ID() != Record_ID && Record_ID > 0)
|
if (po.get_ID() != Record_ID && Record_ID > 0)
|
||||||
po = null;
|
po = null;
|
||||||
else
|
|
||||||
{
|
|
||||||
s_modelFactoryCache.put(tableName, factory);
|
s_modelFactoryCache.put(tableName, factory);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
if (po == null)
|
if (po == null && s_modelFactoryCache.get(tableName) == null)
|
||||||
{
|
{
|
||||||
po = new GenericPO(tableName, getCtx(), Record_ID, trxName);
|
po = new GenericPO(tableName, getCtx(), Record_ID, trxName);
|
||||||
if (po.get_ID() != Record_ID && Record_ID > 0)
|
if (po.get_ID() != Record_ID && Record_ID > 0)
|
||||||
po = null;
|
po = null;
|
||||||
|
// TODO: how to add GenericPO to the s_modelFactoryCache ??
|
||||||
}
|
}
|
||||||
|
|
||||||
return po;
|
return po;
|
||||||
|
|
Loading…
Reference in New Issue