openjpa-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From zoltankesz <>
Subject Re: [jira] Created: (OPENJPA-1750) Prepared query with enum parameter fails when query is cached
Date Thu, 18 Nov 2010 16:57:31 GMT

We had similar problems. We used named query, with a list of enum values in
an IN :param form. Every time we run the code, it was initially running ok,
but after the first run it was giving a exception:

Caused by: <openjpa-2.0.0-r422266:935683 nonfatal user error> 
org.apache.openjpa.persistence.ArgumentException: The specified parameter of
type "class hu.volksbank.bookingmanagement.domain.enums.BookingStatus" is
not a valid query parameter.

After a lot of fiddling around, we have found a solution:
set query.setFirstResult(), and query.setMaxResults() on the Query object,
it will fix the problem.ű

NOTE !!: when you set a maxResult of Integer.MAX_VALUE, the above solution
doesn't work. I haven't tried what's the actual max value you can set, but
for me a value of 10 000 000 worked fine.

View this message in context:
Sent from the OpenJPA Developers mailing list archive at

View raw message