NullPointerException when calling StoredProcedureQuery.getResultStream() instead of StoredProcedureQuery.getResultList()

Description

Dear team,

After performance latency and Out of Memory issues of using javax.persistence.StoredProcedureQuery.getResultList() during for data lookup, I decide to use javax.persistence.StoredProcedureQuery.getResultStream() to avoid them.

But this leads to a NullPointerException because of missing implementation of org.hibernate.procedure.ProcedureCall.getQueryString() called by session scroll as you can see in the below trace.

 

 

 

[TRACE]
java.lang.NullPointerException: null
at org.hibernate.engine.query.spi.QueryPlanCache$HQLQueryPlanKey.<init>(QueryPlanCache.java:299) ~[hibernate-core-5.3.9.Final.jar:5.3.9.Final]
at org.hibernate.engine.query.spi.QueryPlanCache.getHQLQueryPlan(QueryPlanCache.java:149) ~[hibernate-core-5.3.9.Final.jar:5.3.9.Final]
at org.hibernate.internal.AbstractSharedSessionContract.getQueryPlan(AbstractSharedSessionContract.java:605) ~[hibernate-core-5.3.9.Final.jar:5.3.9.Final]
at org.hibernate.internal.SessionImpl.scroll(SessionImpl.java:1632) ~[hibernate-core-5.3.9.Final.jar:5.3.9.Final]
at org.hibernate.query.internal.AbstractProducedQuery.doScroll(AbstractProducedQuery.java:1476) ~[hibernate-core-5.3.9.Final.jar:5.3.9.Final]
at org.hibernate.query.internal.AbstractProducedQuery.scroll(AbstractProducedQuery.java:1462) ~[hibernate-core-5.3.9.Final.jar:5.3.9.Final]
at org.hibernate.query.internal.AbstractProducedQuery.stream(AbstractProducedQuery.java:1486) ~[hibernate-core-5.3.9.Final.jar:5.3.9.Final]
at org.hibernate.query.Query.getResultStream(Query.java:1107) ~[hibernate-core-5.3.9.Final.jar:5.3.9.Final]
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:1.8.0_202]
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) ~[?:1.8.0_202]
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) ~[?:1.8.0_202]
at java.lang.reflect.Method.invoke(Unknown Source) ~[?:1.8.0_202]
at org.springframework.orm.jpa.SharedEntityManagerCreator$DeferredQueryInvocationHandler.invoke(SharedEntityManagerCreator.java:402) ~[spring-orm-5.1.6.RELEASE.jar:5.1.6.RELEASE]
at com.sun.proxy.$Proxy164.getResultStream(Unknown Source) ~[?:?]

/TRACE

Thanks and regards,

Environment

Windows 10, Sybase ASE, Eclipse, JPA 2.2, SpringBoot 2, Java 1.8u202, Spring-orm 5

Status

Assignee

Nathan Xu

Reporter

BakaryD

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

Blocker
Configure