-
Notifications
You must be signed in to change notification settings - Fork 1.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Converter called multiple times evaluating aggregation operation query methods #4712
Comments
Thank you for reaching out - If you'd like us to spend some time investigating, please take the time to provide a complete minimal sample (something that we can unzip or git clone, build, and deploy) that reproduces the problem. |
I find it difficult to provide samples involving databases; it's very troublesome. Perhaps you could simply set up a project. Define your converter:
Define the interface:
Define the enumeration:
Then create a Spring Data interface:
You can test two scenarios: one based on @Aggregation and one based on a named method. However, I have tested it before, and using repository.find(Example) does not cause such issues. Only when using @query or @Aggregation to execute queries with native SQL, the converter gets called multiple times. |
thanks for the feedback - I see the invocations now. there's multiple things contributing to this. we'll look into those. |
Parsing of string based aggregations lead to multiple invocations of potential converters due to missing reuse of bound parameter value as well as attempts to verify out/merge stages within the pipeline that triggered the stage to be converted into the target document. The changes in this commit, reduce the number down to 2. One for examining potential expression dependencies and one for the actual conversion and parameter binding. See #4712 Original pull request: #4717
Parsing of string based aggregations lead to multiple invocations of potential converters due to missing reuse of bound parameter value as well as attempts to verify out/merge stages within the pipeline that triggered the stage to be converted into the target document. The changes in this commit, reduce the number down to 2. One for examining potential expression dependencies and one for the actual conversion and parameter binding. See #4712 Original pull request: #4717
Parsing of string based aggregations lead to multiple invocations of potential converters due to missing reuse of bound parameter value as well as attempts to verify out/merge stages within the pipeline that triggered the stage to be converted into the target document. The changes in this commit, reduce the number down to 2. One for examining potential expression dependencies and one for the actual conversion and parameter binding. See #4712 Original pull request: #4717
my Converter
Pass the enumeration as a parameter,my enum impl -> ConverterEnum
"I found that the Converter was called multiple times, and the source was always the same enumeration, ENUM_COMMERCE_ITEM_DELETED_UNDELETE, because I called this query method in the business logic."
I only called the query method once, but the Converter was called multiple times. Why?
The text was updated successfully, but these errors were encountered: