[hibernate-issues] [JIRA] (HHH-13957) org.hibernate.QueryException: Ordinal parameter not bound : 1

Sergey Smith (JIRA) jira at hibernate.atlassian.net
Sat Apr 18 16:48:47 EDT 2020


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

Hibernate ORM ( https://hibernate.atlassian.net/browse/HHH?atlOrigin=eyJpIjoiZmE2N2M0MDBjZDM4NGMwYzgwNjg3ZTIzN2FiOTlhODIiLCJwIjoiaiJ9 ) / Bug ( https://hibernate.atlassian.net/browse/HHH-13957?atlOrigin=eyJpIjoiZmE2N2M0MDBjZDM4NGMwYzgwNjg3ZTIzN2FiOTlhODIiLCJwIjoiaiJ9 ) HHH-13957 ( https://hibernate.atlassian.net/browse/HHH-13957?atlOrigin=eyJpIjoiZmE2N2M0MDBjZDM4NGMwYzgwNjg3ZTIzN2FiOTlhODIiLCJwIjoiaiJ9 ) org.hibernate.QueryException: Ordinal parameter not bound : 1 ( https://hibernate.atlassian.net/browse/HHH-13957?atlOrigin=eyJpIjoiZmE2N2M0MDBjZDM4NGMwYzgwNjg3ZTIzN2FiOTlhODIiLCJwIjoiaiJ9 )

Issue Type: Bug Affects Versions: 5.4.14 Assignee: Unassigned Components: hibernate-core Created: 18/Apr/2020 13:48 PM Priority: Minor Reporter: Sergey Smith ( https://hibernate.atlassian.net/secure/ViewProfile.jspa?accountId=5e9b5e457a2ea00c155a41e1 )

"reserveFirstParameter" boolean parameter is being ignored in QueryParameterBindingsImpl#verifyParametersBound and this leads to
throw new QueryException( "Ordinal parameter not bound : " + parameter.getPosition() );
when the first parameter is being checked.

Initial conditions:
1. Have the following Oracle procedure:
PROCEDURE LoadValuesUsingOracleRefCursor( returning_values IN OUT SYS_REFCURSOR, some_parameters IN CLOB ) AS BEGIN ... END LoadValuesUsingOracleRefCursor;

2. Have the following named query in a hbm.xml file:
<sql-query name="load_values_from_db" callable="true">

{call LoadValuesUsingOracleRefCursor(?, ?)}

</sql-query>

Test case:
NativeQuery query = entityManager.unwrap(Session.class).getNamedNativeQuery("load_values_from_db");
query.setParameter(2, "A_STRING_VALUE");
query.list;

Actual result: Following exception is thwrown:
Caused by: org.hibernate.QueryException: Ordinal parameter not bound : 1
at org.hibernate.query.internal.QueryParameterBindingsImpl.verifyParametersBound(QueryParameterBindingsImpl.java:213)
at org.hibernate.query.internal.AbstractProducedQuery.beforeQuery(AbstractProducedQuery.java:1425)
at org.hibernate.query.internal.NativeQueryImpl.beforeQuery(NativeQueryImpl.java:249)
at org.hibernate.query.internal.AbstractProducedQuery.list(AbstractProducedQuery.java:1531)

Sometime it's impossible to use StoredProcedureQuery with its registerStoredProcedureParameter(1, Class.class, ParameterMode.REF_CURSOR), because WebLogic 12.2.1 still uses JDBC 4.0 Oracle driver, not 4.2.

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

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#100124- sha1:93e2dd3 )
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.jboss.org/pipermail/hibernate-issues/attachments/20200418/13c36dc9/attachment.html 


More information about the hibernate-issues mailing list