diff --git a/org.adempiere.base/src/org/compiere/model/PO.java b/org.adempiere.base/src/org/compiere/model/PO.java index 6870422c65..ba438a998a 100644 --- a/org.adempiere.base/src/org/compiere/model/PO.java +++ b/org.adempiere.base/src/org/compiere/model/PO.java @@ -232,9 +232,9 @@ public abstract class PO private static CLogger s_log = CLogger.getCLogger (PO.class); /** Context */ - protected Properties p_ctx; + protected transient Properties p_ctx; /** Model Info */ - protected volatile POInfo p_info = null; + protected transient volatile POInfo p_info = null; /** Original Values */ private Object[] m_oldValues = null; @@ -4820,6 +4820,8 @@ public abstract class PO // default deserialization ois.defaultReadObject(); log = CLogger.getCLogger(getClass()); + p_ctx = Env.getCtx(); + p_info = initPO(p_ctx); } public void set_Attribute(String columnName, Object value) { diff --git a/org.adempiere.base/src/org/compiere/model/POInfo.java b/org.adempiere.base/src/org/compiere/model/POInfo.java index 46ca4f9ab5..5c49eb1f9d 100644 --- a/org.adempiere.base/src/org/compiere/model/POInfo.java +++ b/org.adempiere.base/src/org/compiere/model/POInfo.java @@ -16,6 +16,8 @@ *****************************************************************************/ package org.compiere.model; +import java.io.IOException; +import java.io.ObjectInputStream; import java.io.Serializable; import java.math.BigDecimal; import java.sql.PreparedStatement; @@ -86,7 +88,7 @@ public class POInfo implements Serializable } // getPOInfo /** Cache of POInfo */ - private static CCache s_cache = new CCache(I_AD_Table.Table_Name, "POInfo", 200); + private static CCache s_cache = new CCache(I_AD_Table.Table_Name, "POInfo", 200, 0, false, 0); /************************************************************************** * Create Persistent Info @@ -115,7 +117,7 @@ public class POInfo implements Serializable } // PInfo /** Context */ - private Properties m_ctx = null; + private transient Properties m_ctx = null; /** Table_ID */ private int m_AD_Table_ID = 0; /** Table Name */ @@ -835,4 +837,10 @@ public class POInfo implements Serializable return m_IsChangeLog; } + private void readObject(ObjectInputStream ois) + throws ClassNotFoundException, IOException { + // default deserialization + ois.defaultReadObject(); + m_ctx = Env.getCtx(); + } } // POInfo