IDEMPIERE-5534 Make configurable the maximum records in lists (#1630)

* IDEMPIERE-5534 Make configurable the maximum records in lists

* - Impose hardcoded limit of 50.000 as suggested by Heng Sin

* - SysConfig name MAX_ROWS_IN_TABLE_COMBOLIST

* - change message
This commit is contained in:
Carlos Ruiz 2023-01-19 12:16:07 +01:00 committed by GitHub
parent 54659001ff
commit c28655af5f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 25 additions and 3 deletions

View File

@ -0,0 +1,10 @@
-- IDEMPIERE-5534 Make configurable the maximum records in lists
SELECT register_migration_script('202301062010_IDEMPIERE-5534.sql') FROM dual;
SET SQLBLANKLINES ON
SET DEFINE OFF
-- Jan 6, 2023, 8:10:55 PM CET
INSERT INTO AD_SysConfig (AD_SysConfig_ID,AD_Client_ID,AD_Org_ID,Created,Updated,CreatedBy,UpdatedBy,IsActive,Name,Value,Description,EntityType,ConfigurationLevel,AD_SysConfig_UU) VALUES (200215,0,0,TO_TIMESTAMP('2023-01-06 20:10:55','YYYY-MM-DD HH24:MI:SS'),TO_TIMESTAMP('2023-01-06 20:10:55','YYYY-MM-DD HH24:MI:SS'),100,100,'Y','MAX_ROWS_IN_TABLE_COMBOLIST','10000','Maximum number of records in lists (records in Table/TableDirect). WARNING: increasing this value affects heavily performance and memory, use it wisely. Max possible value is 50,000','D','C','051dafef-b66e-40ec-8a88-215aeb6c0355')
;

View File

@ -0,0 +1,7 @@
-- IDEMPIERE-5534 Make configurable the maximum records in lists
SELECT register_migration_script('202301062010_IDEMPIERE-5534.sql') FROM dual;
-- Jan 6, 2023, 8:10:55 PM CET
INSERT INTO AD_SysConfig (AD_SysConfig_ID,AD_Client_ID,AD_Org_ID,Created,Updated,CreatedBy,UpdatedBy,IsActive,Name,Value,Description,EntityType,ConfigurationLevel,AD_SysConfig_UU) VALUES (200215,0,0,TO_TIMESTAMP('2023-01-06 20:10:55','YYYY-MM-DD HH24:MI:SS'),TO_TIMESTAMP('2023-01-06 20:10:55','YYYY-MM-DD HH24:MI:SS'),100,100,'Y','MAX_ROWS_IN_TABLE_COMBOLIST','10000','Maximum number of records in lists (records in Table/TableDirect). WARNING: increasing this value affects heavily performance and memory, use it wisely. Max possible value is 50,000','D','C','051dafef-b66e-40ec-8a88-215aeb6c0355')
;

View File

@ -98,8 +98,6 @@ public final class MLookup extends Lookup implements Serializable
public static final String INACTIVE_S = "~";
/** Inactive Marker End */
public static final String INACTIVE_E = "~";
/** Number of max rows to load */
private static final int MAX_ROWS = 5000;
/** Indicator for Null */
private static Integer MINUS_ONE = Integer.valueOf(-1);
@ -997,6 +995,12 @@ public final class MLookup extends Lookup implements Serializable
*/
protected void doRun()
{
/** Number of max rows to load */
int MAX_ROWS = MSysConfig.getIntValue(MSysConfig.MAX_ROWS_IN_TABLE_COMBOLIST, 10000, Env.getAD_Client_ID(Env.getCtx()));
if (MAX_ROWS > 50000) {
log.warning("SysConfig MAX_ROWS_IN_TABLE_COMBOLIST set back to maximum allowed value of 50.000");
MAX_ROWS = 50000; // impose hardcoded limit of 50.000
}
long startTime = System.currentTimeMillis();
StringBuilder sql = new StringBuilder().append(m_info.Query);

View File

@ -44,7 +44,7 @@ public class MSysConfig extends X_AD_SysConfig
/**
*
*/
private static final long serialVersionUID = 6202541582080272987L;
private static final long serialVersionUID = -1169550637760344445L;
public static final String ADDRESS_VALIDATION = "ADDRESS_VALIDATION";
public static final String ALERT_SEND_ATTACHMENT_AS_XLS = "ALERT_SEND_ATTACHMENT_AS_XLS";
@ -137,6 +137,7 @@ public class MSysConfig extends X_AD_SysConfig
public static final String MAIL_SEND_CREDENTIALS = "MAIL_SEND_CREDENTIALS";
public static final String MAX_ACTIVITIES_IN_LIST = "MAX_ACTIVITIES_IN_LIST";
public static final String MAX_RESULTS_PER_SEARCH_IN_DOCUMENT_CONTROLLER = "MAX_RESULTS_PER_SEARCH_IN_DOCUMENT_CONTROLLER";
public static final String MAX_ROWS_IN_TABLE_COMBOLIST = "MAX_ROWS_IN_TABLE_COMBOLIST";
public static final String MAX_TEXT_LENGTH_ON_GRID_VIEW = "MAX_TEXT_LENGTH_ON_GRID_VIEW";
public static final String MENU_INFOUPDATER_SLEEP_MS = "MENU_INFOUPDATER_SLEEP_MS";
public static final String MESSAGES_AT_TENANT_LEVEL = "MESSAGES_AT_TENANT_LEVEL";