Maurice (
https://hibernate.atlassian.net/secure/ViewProfile.jspa?accountId=5b0057d...
) *created* an issue
Hibernate ORM (
https://hibernate.atlassian.net/browse/HHH?atlOrigin=eyJpIjoiZmU0MjM4ZTMz...
) / Bug (
https://hibernate.atlassian.net/browse/HHH-13983?atlOrigin=eyJpIjoiZmU0Mj...
) HHH-13983 (
https://hibernate.atlassian.net/browse/HHH-13983?atlOrigin=eyJpIjoiZmU0Mj...
) org.hibernate.procedure.ProcedureOutputsImpl tries to map all returned resultsets to the
column set of the first resultset (
https://hibernate.atlassian.net/browse/HHH-13983?atlOrigin=eyJpIjoiZmU0Mj...
)
Issue Type: Bug Affects Versions: 4.3.5 Assignee: Unassigned Components: query-sql
Created: 27/Apr/2020 04:00 AM Environment: Database: MySql 8.0, Hibernate 4.3.5 Priority:
Minor Reporter: Maurice (
https://hibernate.atlassian.net/secure/ViewProfile.jspa?accountId=5b0057d...
)
I have a stored procedure that returns different resultsets each consisting of different
columns. I use an implementation object of ProcedureOutputs to retrieve each resultset
consequtively using the method callOutputs.getCurrent() and callOutputs.goToNext() in a
while loop. This first one is always retrieved without issues. The second one however will
throw a `Column 'xyz' does not exist` error when the first resultset happens to
contain a column xyz that it does not share with the second resultset retrieved. Only when
the second and any other resultset after that have the exact same column set, with all
columns arranged in the same order, no problems arise. But often this is not the case.
The bug is thus that hibernate tries to map any consecutive resultset to the same column
set that existed in the first resultset. I don't know why it tries to do this. It
reminds me of another functionality where Hibernate casts one resultset to a predefined
entity. But it shouldn't do that here, because it is simply not instructed to do so.
Here are two threads on stackoverflow and dba that also report this problem.
https://stackoverflow.com/questions/24641818/using-jpa-with-stored-proced...
https://dba.stackexchange.com/questions/265890/can-a-mysql-stored-procedu...
(
https://hibernate.atlassian.net/browse/HHH-13983#add-comment?atlOrigin=ey...
) Add Comment (
https://hibernate.atlassian.net/browse/HHH-13983#add-comment?atlOrigin=ey...
)
Get Jira notifications on your phone! Download the Jira Cloud app for Android (
https://play.google.com/store/apps/details?id=com.atlassian.android.jira....
) or iOS (
https://itunes.apple.com/app/apple-store/id1006972087?pt=696495&ct=Em...
) This message was sent by Atlassian Jira (v1001.0.0-SNAPSHOT#100125- sha1:c966059 )