"ORA-00942: table or view does not exist" in case cacheable native query

Description

After upgrade from 3.6 to 5.2 we start getting the ORA-00942: table or view does not exist

Reproduced when query cache is ON
second level cache is ON
as well as when createNativeQuery(String sqlString, Class resultClass) is used .

Hibernate trying to do select from resultClass

Test attached. In actual application we do select from view, not table and from more complex union selects.

Environment

None

Activity

Show:
Chris Cranford
May 11, 2018, 6:26 PM

Any particular reason why you are not using a @SqlResultSetMapping for these use cases and calling:

Ivan Badanov
May 11, 2018, 6:40 PM

No reasons. Just tried with

and

and got same error

Table "ADDRESSNATIVESQL" not found; SQL statement:

Chris Cranford
May 13, 2018, 6:49 PM

Please don't randomly assign a JIRA to a user. Sometimes we comment on issues to try and gather more information but that does not mean we'll be the one to work the issue.

Assignee

Unassigned

Reporter

Ivan Badanov

Fix versions

None

Labels

None

backPortable

None

Suitable for new contributors

None

Requires Release Note

None

Pull Request

None

backportDecision

None

Components

Affects versions

Priority

Major
Configure