borinquenkid opened a new issue, #16814: URL: https://github.com/apache/grails-core/issues/16814
Split from audit #16804 (findings F1, F26). ### Problem Description Deferred criteria (`whereLazy`, `buildLazy`) and subqueries built by the AST transformer exhibit two critical lifecycle defects: 1. **Unmaterialized Subqueries (F1)**: Deferred criteria used inside subquery criteria were not materialized prior to translation, causing restrictions to be dropped. 2. **In-Place Mutation Race Condition (F26)**: `applyLazyCriteria()` executes the closure in-place on the shared `DetachedCriteria` instance. If a criteria is shared across concurrent queries or threads, the closure executes repeatedly, duplicating criteria and projections. ### Expected Behavior Introduce `QueryableCriteria.materializeLazyCriteria()` (and implement on `DetachedCriteria`) which clones the criteria and executes the closure on the copy, leaving the original criteria immutable and thread-safe. -- 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]
