* Part of the fix for bug [1628515]

This commit is contained in:
Heng Sin Low 2007-01-05 12:20:39 +00:00
parent b2cce7d61f
commit 6d9d26be64
1 changed files with 39 additions and 32 deletions

View File

@ -2461,42 +2461,49 @@ public abstract class PO
else else
{ {
if (localTrx != null) if (localTrx != null)
localTrx.commit(); success = localTrx.commit();
// Change Log if (success)
MSession session = MSession.get (p_ctx, false);
if (session == null)
log.fine("No Session found");
else if (m_IDs.length == 1
&& MChangeLog.isLogged(AD_Table_ID))
{ {
int AD_ChangeLog_ID = 0; // Change Log
int size = get_ColumnCount(); MSession session = MSession.get (p_ctx, false);
for (int i = 0; i < size; i++) if (session == null)
log.fine("No Session found");
else if (m_IDs.length == 1
&& MChangeLog.isLogged(AD_Table_ID))
{ {
Object value = m_oldValues[i]; int AD_ChangeLog_ID = 0;
if (value != null int size = get_ColumnCount();
&& !p_info.isEncrypted(i) // not encrypted for (int i = 0; i < size; i++)
&& !p_info.isVirtualColumn(i) // no virtual column
&& !"Password".equals(p_info.getColumnName(i))
)
{ {
MChangeLog cLog = session.changeLog ( Object value = m_oldValues[i];
m_trxName, AD_ChangeLog_ID, if (value != null
AD_Table_ID, p_info.getColumn(i).AD_Column_ID, && !p_info.isEncrypted(i) // not encrypted
Record_ID, getAD_Client_ID(), getAD_Org_ID(), value, null); && !p_info.isVirtualColumn(i) // no virtual column
if (cLog != null) && !"Password".equals(p_info.getColumnName(i))
AD_ChangeLog_ID = cLog.getAD_ChangeLog_ID(); )
} {
} // for all fields MChangeLog cLog = session.changeLog (
m_trxName, AD_ChangeLog_ID,
AD_Table_ID, p_info.getColumn(i).AD_Column_ID,
Record_ID, getAD_Client_ID(), getAD_Org_ID(), value, null);
if (cLog != null)
AD_ChangeLog_ID = cLog.getAD_ChangeLog_ID();
}
} // for all fields
}
// Housekeeping
m_IDs[0] = I_ZERO;
if (m_trxName == null)
log.fine("complete");
else
log.fine("[" + m_trxName + "] - complete");
m_attachment = null;
}
else
{
log.warning("Not deleted");
} }
// Housekeeping
m_IDs[0] = I_ZERO;
if (m_trxName == null)
log.fine("complete");
else
log.fine("[" + m_trxName + "] - complete");
m_attachment = null;
} }
if (localTrx != null) if (localTrx != null)
localTrx.close(); localTrx.close();