IDEMPIERE-4330 New tables are not logged - requires a server restart (#111)
* IDEMPIERE-4330 New tables are not logged - requires a server restart * IDEMPIERE-4330 New tables are not logged - requires a server restart Add synchronized to isLogged and resetLoggedList as advised by Heng Sin
This commit is contained in:
parent
5adad12309
commit
aac7d81077
|
@ -37,15 +37,14 @@ public class MChangeLog extends X_AD_ChangeLog
|
|||
/**
|
||||
*
|
||||
*/
|
||||
private static final long serialVersionUID = -7156972859181201446L;
|
||||
|
||||
private static final long serialVersionUID = 7262833610411402160L;
|
||||
|
||||
/**
|
||||
* Do we track changes for this table
|
||||
* @param AD_Table_ID table
|
||||
* @return true if changes are tracked
|
||||
*/
|
||||
public static boolean isLogged (int AD_Table_ID)
|
||||
public static synchronized boolean isLogged (int AD_Table_ID)
|
||||
{
|
||||
if (s_changeLog == null || s_changeLog.length == 0)
|
||||
fillChangeLog();
|
||||
|
@ -53,6 +52,10 @@ public class MChangeLog extends X_AD_ChangeLog
|
|||
int index = Arrays.binarySearch(s_changeLog, AD_Table_ID);
|
||||
return index >= 0;
|
||||
} // trackChanges
|
||||
|
||||
public static synchronized void resetLoggedList() {
|
||||
s_changeLog = null;
|
||||
}
|
||||
|
||||
/**
|
||||
* Fill Log with tables to be logged
|
||||
|
|
|
@ -498,6 +498,12 @@ public class MColumn extends X_AD_Column
|
|||
}
|
||||
*/
|
||||
|
||||
if ((newRecord || is_ValueChanged(COLUMNNAME_ColumnName))
|
||||
&& ( "EntityType".equals(getColumnName())
|
||||
|| "EntityType".equals(get_ValueOld(COLUMNNAME_ColumnName).toString()))) {
|
||||
MChangeLog.resetLoggedList();
|
||||
}
|
||||
|
||||
return success;
|
||||
} // afterSave
|
||||
|
||||
|
|
|
@ -568,6 +568,9 @@ public class MTable extends X_AD_Table
|
|||
seq.setName(getTableName());
|
||||
seq.saveEx();
|
||||
}
|
||||
if (newRecord || is_ValueChanged(COLUMNNAME_IsChangeLog)) {
|
||||
MChangeLog.resetLoggedList();
|
||||
}
|
||||
|
||||
return success;
|
||||
} // afterSave
|
||||
|
|
Loading…
Reference in New Issue