I have a query like:
@Query("select I from Indicator I where I.bankId in (:bankIds) ")
public List<Indicator> getIndicatorDetailsByBankIdList(@Param("bankIds") Set<Long> bankIdList);
This is working fine most of the time. At times it's throwing the following exception.
Description - Parameter with that name [bankIds] did not exist; nested exception is java.lang.IllegalArgumentException: Parameter with that name [bankIds] did not exist, StackTrace - java.lang.IllegalArgumentException: Parameter with that name [bankIds] did not exist
at org.hibernate.jpa.spi.BaseQueryImpl.findParameterRegistration(BaseQueryImpl.java:505)
at org.hibernate.jpa.spi.BaseQueryImpl.setParameter(BaseQueryImpl.java:631)
at org.hibernate.jpa.spi.AbstractQueryImpl.setParameter(AbstractQueryImpl.java:180)
at org.hibernate.jpa.spi.AbstractQueryImpl.setParameter(AbstractQueryImpl.java:49)
Observations
I'm not sure how right i'm adding in this observation, but i guess the service fails only when used inside modules which are little on the data heavy side (even here it fails only at times). Does memory issues cause these kind of exceptions to be thrown?
Inconsistant issue was observed on another method on the same entity:
@Query("select I from Indicator I where I.activityId in (:activityIds) ")
public List<Indicator> getIndicatorDetailsByActivityIdList(@Param("activityIds") Set<Long> acyIdList);