setParameter doesn't work in native Query if Query is already executed with different parameter value for collection type when new collection length is less than the previous

Description

setParameter doesn't work if Query is already executed with different parameter value for collection type when new collection length is less than the old.

Caused by: org.hibernate.QueryException: Named parameter does not appear in Query: ids_2 [update student set status=?, modification_time = CURRENT_TIMESTAMP where id in (?, ?)]
at org.hibernate.engine.query.spi.NativeSQLQueryPlan.getNamedParameterLocs(NativeSQLQueryPlan.java:65)
at org.hibernate.engine.query.spi.NativeSQLQueryPlan.bindNamedParameters(NativeSQLQueryPlan.java:134)
at org.hibernate.engine.query.spi.NativeSQLQueryPlan.performExecuteUpdate(NativeSQLQueryPlan.java:200)
at org.hibernate.internal.SessionImpl.executeNativeUpdate(SessionImpl.java:1575)
at org.hibernate.query.internal.NativeQueryImpl.doExecuteUpdate(NativeQueryImpl.java:274)
at org.hibernate.query.internal.AbstractProducedQuery.executeUpdate(AbstractProducedQuery.java:1504)
... 29 more

Environment

None

Assignee

Rabin Banerjee

Reporter

Rabin Banerjee

Fix versions

None

Labels

None

backPortable

None

Suitable for new contributors

None

Requires Release Note

None

backportDecision

None

Affects versions

Priority

Critical
Configure