My Oracle Support Banner

Kodo JDO generates incorrect sql query with additional unnecessary conditions (Doc ID 1404493.1)

Last updated on FEBRUARY 25, 2020

Applies to:

Oracle WebLogic Server - Version 10.3.4 and later
Information in this document applies to any platform.


After upgrading the application from the WLS 10.3.0 to WLS 10.3.4, it is observed that the sql query generated by Kodo JDO becomes incorrect.

The entity EJB is defined as POJO.  The EJB is then added and defined in the main file. The build script runs through the Kodo PCEnhancerTask. The enhanced POJO/entity is packaged as a JAR file and added to the server classpath. The application that uses the EJB is deployed as a separate EAR file. The POJO is called from various places (eg. Message Driven Bean, web web application, or session bean) by the application in the EAR file.

The EJB uses inheritance, with base class, and subclass

In WLS 10.3.0, Kodo debugs show the correctly generated query -

11344 TRACE [main] openjpa.jdbc.SQL - <...> executing prepstmnt 20189571 SELECT <COLUMN_LIST>
FROM <TABLE_0> t0, <TABLE_1> t1 WHERE t1.JDOID = ? AND t1.JDOID = t0.JDOID [params=(long) <VALUE>] [reused=0]

But in WLS 10.3.4, Kodo generates the following query -

3969 TRACE [main] openjpa.jdbc.SQL - <...> executing prepstmnt 18489944 SELECT <COLUMN_LIST>
FROM <TABLE_0> t0, <TABLE_1> t1 WHERE t1.JDOCLASS = ? AND t0.JDOID = ? AND t0.JDOID = t1.JDOID [params=(String) <PACKAGE>.<CLASSNAME>, (long) <VALUE>] [reused=0]

The highlighted differences above show an extra string of  t1.JDOCLASS = ? AND in the WHERE clause.  In addition, the JDOID parameter input in  t1.JDOID = t0.JDOID  shows an extra String definition in WLS 10.3.4.

As a result of the incorrectly generated query by Kodo for the JDO, the EJB query fails in the application in WLS 10.3.4.


To view full details, sign in with your My Oracle Support account.

Don't have a My Oracle Support account? Click to get started!

In this Document

My Oracle Support provides customers with access to over a million knowledge articles and a vibrant support community of peers and Oracle experts.