Fixes are available
8.5.5.3: WebSphere Application Server V8.5.5 Fix Pack 3
8.5.5.4: WebSphere Application Server V8.5.5 Fix Pack 4
8.5.5.5: WebSphere Application Server V8.5.5 Fix Pack 5
8.5.5.6: WebSphere Application Server V8.5.5 Fix Pack 6
8.5.5.7: WebSphere Application Server V8.5.5 Fix Pack 7
8.5.5.8: WebSphere Application Server V8.5.5 Fix Pack 8
8.5.5.9: WebSphere Application Server V8.5.5 Fix Pack 9
8.5.5.10: WebSphere Application Server V8.5.5 Fix Pack 10
8.5.5.11: WebSphere Application Server V8.5.5 Fix Pack 11
8.0.0.13: WebSphere Application Server V8.0 Fix Pack 13
8.5.5.12: WebSphere Application Server V8.5.5 Fix Pack 12
8.0.0.14: WebSphere Application Server V8.0 Fix Pack 14
8.5.5.13: WebSphere Application Server V8.5.5 Fix Pack 13
8.0.0.15: WebSphere Application Server V8.0 Fix Pack 15
8.5.5.14: WebSphere Application Server V8.5.5 Fix Pack 14
8.5.5.15: WebSphere Application Server V8.5.5 Fix Pack 15
8.5.5.14: WebSphere Application Server V8.5.5 Fix Pack 14
8.5.5.17: WebSphere Application Server V8.5.5 Fix Pack 17
8.5.5.20: WebSphere Application Server V8.5.5.20
8.5.5.18: WebSphere Application Server V8.5.5 Fix Pack 18
8.5.5.19: WebSphere Application Server V8.5.5 Fix Pack 19
8.5.5.16: WebSphere Application Server V8.5.5 Fix Pack 16
8.5.5.21: WebSphere Application Server V8.5.5.21
APAR status
Closed as program error.
Error description
In an attempt to use date literals for data range in JPQL, the following error occurs: Caused by: <openjpa-2.2.1.1-SNAPSHOT-r422266:1438134 nonfatal user error> org.apache.openjpa.persistence.ArgumentException: Attempt to compare incompatible types "class java.util.Date" and "class org.apache. openjpa.jdbc.sql.Raw". at org.apache.openjpa.jdbc.kernel.exps.CompareExpression.appendTo (CompareExpression.java:72) at org.apache.openjpa.jdbc.kernel.exps.AndExpression.appendTo (AndExpression.java:59) at org.apache.openjpa.jdbc.kernel.exps.AndExpression.appendTo (AndExpression.java:59) at org.apache.openjpa.jdbc.kernel.exps.BindVariableAndExpression. appendTo(BindVariableAndExpression.java:57) at org.apache.openjpa.jdbc.kernel.exps.SelectConstructor.buildWhere (SelectConstructor.java:312) at org.apache.openjpa.jdbc.kernel.exps.SelectConstructor.evaluate (SelectConstructor.java:94) at org.apache.openjpa.jdbc.kernel.JDBCStoreQuery.createWhereSelects (JDBCStoreQuery.java:360) at org.apache.openjpa.jdbc.kernel.JDBCStoreQuery.executeQuery (JDBCStoreQuery.java:193) at org.apache.openjpa.kernel.ExpressionStoreQuery$DataStoreExecutor . executeQuery(????????????????) at org.apache.openjpa.kernel.QueryImpl.execute(QueryImpl.java:1005) at org.apache.openjpa.kernel.QueryImpl.execute(QueryImpl.java:863) at org.apache.openjpa.kernel.QueryImpl.execute(QueryImpl.java:794) at org.apache.openjpa.kernel.DelegatingQuery.execute(DelegatingQuer y. java:542) at org.apache.openjpa.persistence.QueryImpl.execute(QueryImpl.java: 286) at org.apache.openjpa.persistence.QueryImpl.getResultList(QueryImpl . java:302) at com.ibm.ws.persistence.QueryImpl.getResultList(QueryImpl.java:11 8)
Local fix
Problem summary
**************************************************************** * USERS AFFECTED: All users of IBM WebSphere Application * * Server V8.0.0, V8.5.0 and V8.5.5 who make * * use of a JPA query which contains a * * Date/Timestamp literal. * **************************************************************** * PROBLEM DESCRIPTION: ArgumentException: Attempt to compare * * incompatible types class * * java.util.Date and class * * org.apache.openjpa.jdbc.sql.Raw * **************************************************************** * RECOMMENDATION: * **************************************************************** Take the following JPA queries: Query q = em.createQuery("SELECT e FROM Employee e WHERE e.hireTimestamp > {ts '2001-01-01 00:00:00'}"); q.getResultList(); q.getResultList(); The first run of the query (i.e. q.getResultList()) will work as expected. The second run will result in the following exception: org.apache.openjpa.persistence.ArgumentException: Attempt to compare incompatible types "class java.util.Date" and "class org.apache.openjpa.jdbc.sql.Raw". at org.apache.openjpa.jdbc.kernel.exps.CompareEqualExpression.appen dTo(CompareEqualExpression.java:101) at org.apache.openjpa.jdbc.kernel.exps.AndExpression.appendTo(AndEx pression.java:65) at org.apache.openjpa.jdbc.kernel.exps.SelectConstructor.buildWhere (SelectConstructor.java:312) at org.apache.openjpa.jdbc.kernel.exps.SelectConstructor.evaluate(S electConstructor.java:94) at org.apache.openjpa.jdbc.kernel.JDBCStoreQuery.createWhereSelects (JDBCStoreQuery.java:360) at org.apache.openjpa.jdbc.kernel.JDBCStoreQuery.executeQuery(JDBCS toreQuery.java:193) at org.apache.openjpa.kernel.ExpressionStoreQuery$DataStoreExecutor .executeQuery(ExpressionStoreQuery.java:783) at org.apache.openjpa.kernel.QueryImpl.execute(QueryImpl.java:1005)
Problem conclusion
With this fix, code has been added to OpenJPA to ensure that a JPA query with Date literals can be run multiple times. The fix for this APAR is currently targeted for inclusion in Service Levels (Fix Packs) 8.0.0.13 and 8.5.5.3 of WebSphere Application Server versions 8.0.0 and 8.5.5. Please refer to the recommended updates page for delivery information: http://www.ibm.com/support/docview.wss?rs=180&uid=swg27004980
Temporary fix
Comments
APAR Information
APAR number
PI13616
Reported component name
WEBS APP SERV N
Reported component ID
5724H8800
Reported release
850
Status
CLOSED PER
PE
NoPE
HIPER
NoHIPER
Special Attention
NoSpecatt / Xsystem
Submitted date
2014-03-12
Closed date
2014-06-20
Last modified date
2016-09-12
APAR is sysrouted FROM one or more of the following:
APAR is sysrouted TO one or more of the following:
Fix information
Fixed component name
WEBS APP SERV N
Fixed component ID
5724H8800
Applicable component levels
R850 PSY
UP
Document Information
Modified date:
28 April 2022