[hibernate-issues] [JIRA] (HHH-13983) org.hibernate.procedure.ProcedureOutputsImpl tries to map all returned resultsets to the column set of the first resultset

Maurice (JIRA) jira at hibernate.atlassian.net
Mon Apr 27 07:00:01 EDT 2020


Maurice ( https://hibernate.atlassian.net/secure/ViewProfile.jspa?accountId=5b0057d0588c2164586ac9b6 ) *created* an issue

Hibernate ORM ( https://hibernate.atlassian.net/browse/HHH?atlOrigin=eyJpIjoiZmU0MjM4ZTMzMmZhNGUwMGI3ZDkzYTE5MzFhYTg0MmMiLCJwIjoiaiJ9 ) / Bug ( https://hibernate.atlassian.net/browse/HHH-13983?atlOrigin=eyJpIjoiZmU0MjM4ZTMzMmZhNGUwMGI3ZDkzYTE5MzFhYTg0MmMiLCJwIjoiaiJ9 ) HHH-13983 ( https://hibernate.atlassian.net/browse/HHH-13983?atlOrigin=eyJpIjoiZmU0MjM4ZTMzMmZhNGUwMGI3ZDkzYTE5MzFhYTg0MmMiLCJwIjoiaiJ9 ) 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=eyJpIjoiZmU0MjM4ZTMzMmZhNGUwMGI3ZDkzYTE5MzFhYTg0MmMiLCJwIjoiaiJ9 )

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=5b0057d0588c2164586ac9b6 )

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-procedures-that-return-multiple-result-sets

https://dba.stackexchange.com/questions/265890/can-a-mysql-stored-procedure-return-multiple-resultsets-each-containing-differen?noredirect=1#comment523515_265890

( https://hibernate.atlassian.net/browse/HHH-13983#add-comment?atlOrigin=eyJpIjoiZmU0MjM4ZTMzMmZhNGUwMGI3ZDkzYTE5MzFhYTg0MmMiLCJwIjoiaiJ9 ) Add Comment ( https://hibernate.atlassian.net/browse/HHH-13983#add-comment?atlOrigin=eyJpIjoiZmU0MjM4ZTMzMmZhNGUwMGI3ZDkzYTE5MzFhYTg0MmMiLCJwIjoiaiJ9 )

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.core&referrer=utm_source%3DNotificationLink%26utm_medium%3DEmail ) or iOS ( https://itunes.apple.com/app/apple-store/id1006972087?pt=696495&ct=EmailNotificationLink&mt=8 ) This message was sent by Atlassian Jira (v1001.0.0-SNAPSHOT#100125- sha1:c966059 )
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.jboss.org/pipermail/hibernate-issues/attachments/20200427/cd2a1c92/attachment-0001.html 


More information about the hibernate-issues mailing list