Reputation: 128
I'm using Hibernate 5.0.12, and Oracle 12c.
Calling from a stored procedure that have multiple REF_CURSOR output and getResultList always return the same data, no matter how many times getResultList is called.
How do I get the 'next' result list?
Def:
@StoredProcedureParameter(mode = ParameterMode.REF_CURSOR, type =Class.class, name = "O_OUTPUT1"),
@StoredProcedureParameter(mode = ParameterMode.REF_CURSOR, type =Class.class, name = "O_OUTPUT2"),
query.execute();
query.getResultList(); // This will return list of values
query.getResultList(); // This returns THE SAME list of values
Upvotes: 1
Views: 840
Reputation: 128
Known Hibernate issue (https://hibernate.atlassian.net/browse/HHH-10616). I upgraded to 5.2.15 and used index based access via getOutputParameterValue (see https://hibernate.atlassian.net/browse/HHH-11863). Using EclipseLink also worked, but I wanted to stay with Hibernate.
Upvotes: 1