pushprajsinghjadoun opened a new pull request, #968:
URL: https://github.com/apache/ofbiz-framework/pull/968

   Improved:
   Efficiency of the generic entity search and listing functionality within 
WebTools (FindGeneric.groovy) when handling large datasets.
   
   Implemented:
   Database-level pagination using limit() and offset() via direct EntityQuery 
execution in the Groovy script, eliminating in-memory filtering for large 
result sets.
   
   Documented:
   N/A
   
   Completed:
   Refactoring of the data retrieval logic to ensure EntityListIterator is used 
with a fixed result size, and updating the dynamic form generation to support 
pre-paginated data.
   
   Reverted:
   N/A
   
   Fixed:
   Performance-related system timeouts and memory exhaustion issues encountered 
when performing searches on large entities (e.g., Product) without search 
conditions.
   
   (OFBIZ-):
   OFBIZ-XXXX
   
   Explanation
   
   The previous implementation of FindGeneric.groovy relied on the performFind 
service within the dynamically generated XML form’s <actions> block. This 
approach was inefficient for large datasets because pagination was not 
consistently applied at the database level, often leading to excessive memory 
usage, timeouts, or server crashes when browsing large entities without filters.
   
   This change moves the data retrieval logic directly into the Groovy script. 
By using EntityQuery with explicit limit and offset values derived from the 
VIEW_INDEX and VIEW_SIZE request parameters, only the required subset of 
records is fetched from the database. Additionally, 
getResultsSizeAfterPartialList() is used to provide accurate total counts for 
the UI without loading all records into memory, and the dynamic form renderer 
is informed that the data is already paginated via the override-list-size 
attribute. Support for suffixed pagination parameters (e.g., VIEW_INDEX_1) has 
also been added.
   
   Thanks:
   The OFBiz community and reviewers for their feedback and guidance.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to