Skip to content
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

Cannot receive multiple output parameters from stored procedure with @NamedStoredProcedureQuery [DATAJPA-1722] #2017

Closed
spring-projects-issues opened this issue May 8, 2020 · 6 comments
Assignees
Labels
in: core Issues in core support type: bug A general bug

Comments

@spring-projects-issues
Copy link

AlexanderStepchkov opened DATAJPA-1722 and commented

I'm trying to receive out parameters from simple stored procedure (using Oracle 11g and/or MSSQL 2012).

CREATE OR REPLACE PROCEDURE test_sp(x OUT INTEGER, y OUT INTEGER) AS
BEGIN
 x := 17; y := 93;
END;

 

@Data
@Entity
@NamedStoredProcedureQueries({
        @NamedStoredProcedureQuery(name = "testSp", procedureName = "test_sp", parameters = {
                @StoredProcedureParameter(mode = ParameterMode.OUT, name = "x", type = Integer.class),
                @StoredProcedureParameter(mode = ParameterMode.OUT, name = "y", type = Integer.class)
        })
})
public class SomeEntity {
    @Id
    private Long id;
}

Please check attached demo project for details.

Using annotations I always receive errors: 

java.lang.IllegalArgumentException: OUT/INOUT parameter not available: x

java.lang.IllegalArgumentException: OUT/INOUT parameter not available: 1

However if I use entityManager's createStoredProcedureQuery method it works fine.

 

Link to SO https://stackoverflow.com/questions/61655464/spring-boot-data-jpa-receive-multiple-out-parameters-from-sql-servers-stored-pr


Affects: 2.2.7 (Moore SR7)

Attachments:

1 votes, 2 watchers

@satscreate
Copy link

Any update on this issue using @procedure annotation?

@schauder schauder added the status: waiting-for-triage An issue we've not yet triaged label Feb 23, 2021
@schauder
Copy link
Contributor

The example relies on downloading oracles jdbc driver which resolves as forbidden, it also doesn't come with a database.

Please provide a reproducer that uses an in memory database or brings everything it needs with it, using for example Testcontainers.

If the reproducer is highly database dependent it's likely that the issue is really one of the JPA implementation, i.e. Hibernate in this case. After all Spring Data JPA is based on JPA which is supposed to provide an abstraction over the different databases.

@schauder schauder added status: waiting-for-feedback We need additional information before we can continue and removed status: waiting-for-triage An issue we've not yet triaged labels Feb 24, 2021
@spring-projects-issues
Copy link
Author

If you would like us to look at this issue, please provide the requested information. If the information is not provided within the next 7 days this issue will be closed.

@spring-projects-issues spring-projects-issues added the status: feedback-reminder We've sent a reminder that we need additional information before we can continue label Mar 3, 2021
@satscreate
Copy link

Am on it...will create a quick in memory db setup and attach shortly.

@spring-projects-issues spring-projects-issues added status: feedback-provided Feedback has been provided and removed status: waiting-for-feedback We need additional information before we can continue status: feedback-reminder We've sent a reminder that we need additional information before we can continue labels Mar 8, 2021
@schauder schauder added status: waiting-for-feedback We need additional information before we can continue and removed status: feedback-provided Feedback has been provided labels Mar 9, 2021
@spring-projects-issues
Copy link
Author

If you would like us to look at this issue, please provide the requested information. If the information is not provided within the next 7 days this issue will be closed.

@spring-projects-issues spring-projects-issues added the status: feedback-reminder We've sent a reminder that we need additional information before we can continue label Mar 16, 2021
@spring-projects-issues
Copy link
Author

Closing due to lack of requested feedback. If you would like us to look at this issue, please provide the requested information and we will re-open the issue.

@spring-projects-issues spring-projects-issues removed status: waiting-for-feedback We need additional information before we can continue status: feedback-reminder We've sent a reminder that we need additional information before we can continue labels Mar 23, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
in: core Issues in core support type: bug A general bug
Projects
None yet
Development

No branches or pull requests

3 participants