-
Notifications
You must be signed in to change notification settings - Fork 1.5k
@Procedure
returning also ResultSet
no longer returns Map
for OUT params
#2381
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
Comments
Has anyone had time to look at this yet? Or if this is not considered an issue could you give an example of how it supports multiple out params that include cursors? Thanks |
@Procedure
returning also ResultSet
no longer returns Map
for OUT params
mp911de
added a commit
that referenced
this issue
Oct 21, 2024
Refactor Testcontainers config infrastructure. See #2381
mp911de
added a commit
that referenced
this issue
Oct 21, 2024
…rning also a `ResultSet`. Closes #2381
mp911de
added a commit
that referenced
this issue
Oct 21, 2024
Refactor Testcontainers config infrastructure. See #2381
mp911de
added a commit
that referenced
this issue
Oct 21, 2024
Refactor Testcontainers config infrastructure. See #2381
mp911de
added a commit
that referenced
this issue
Oct 21, 2024
…rning also a `ResultSet`. Closes #2381
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Hi, a change was made in 2.6.0 in JpaQueryExecution.ProcedureExecution.doExecute that has introduced a condition on the doExecute that in the event of true extracts the query results via Hibernate instead of through StoredProcedureJpaQuery.extractOutputValue and returns a different result.
This change means it is no longer possible to execute stored procedures that contain cursors as well as other OUT params in Spring JPA.
i.e.
Release 2.5.7
The object returned is a Map<String,Object>. This can contain multiple OUT params including REF_CURSOR's.
i.e.
Release 2.6.0
In this case for the same query as that run in 2.5.7 the object returned is List<Object[]>. This list will ONLY contain the REF_CURSOR results, for the return structure used it is not possible to include the other OUT params and later identify them. The same would probably apply if more than one REF_CURSOR is in the procedure although I haven't tested this yet.
i.e. Returned object is the forward resultset evaluated where each cursor row is contained in an Object[]
I performed one test where I changed the boolean to false to ensure my query results were extracted through storedProcedureJpaQuery.extractOutputValue(storedProcedure) and found the Map returned contained all results in the same format as previous with 2.5.7.
Was this change in behaviour intentional? I can't find any reference to it in the release notes so not sure why it was done. At the moment on 2.6.0 it doesn't seem to be possible to use Spring Data JPA for procedures with cursors and other OUT params.
Is there a way to change behaviour to use storedProcedureJpaQuery.extractOutputValue(storedProcedure) instead? Our application contains over 500 tables and approx 1000 procedures all of which use a standard pattern where each contains a default of 3 out params containing additional data. It's not possible for us to break this up so support for cursors and out params in the same procedures is essential.
A secondary concern is the cursor rows coming back with no identifying metadata. This removes the ability to use custom convertors to map the forward resultsets to objects as well as introducing vunerabilities when the array position alone is the only means to map column values to object attributes.
More details on this can be found at https://stackoverflow.com/questions/70173380/spring-boot-data-jpa-2-6-0-behavioural-change-on-procedures-with-ref-cursor
Thanks
The text was updated successfully, but these errors were encountered: