APAR status
Closed as program error.
Error description
Running WebSphere Application Server Base 7.0.0.7, using OpenJPA 1.2.3-SNAPSHOT deployed within the container and Oracle 10.x. When doing @VersionStrategy, getting exception: EJSContainer 1 Bean method threw unchecked exception javax.ejb.EJBException: See nested exception; nested exception is: <openjpa-1.2.3-SNAPSHOT-r422266:907835 nonfatal general error> org.apache.openjpa.persistence.PersistenceException: ORA-00918: column ambiguously defined {prepstmnt xxxxxxxxx SELECT ... at org.apache.openjpa.jdbc.sql.DBDictionary.narrow(DBDictionary.jav a:4246) at org.apache.openjpa.jdbc.sql.DBDictionary.newStoreException(DBDic tionary.java:4211) at org.apache.openjpa.jdbc.sql.SQLExceptions.getStore(SQLExceptions .java:102) at org.apache.openjpa.jdbc.sql.SQLExceptions.getStore(SQLExceptions .java:88) at org.apache.openjpa.jdbc.sql.SQLExceptions.getStore(SQLExceptions .java:64) at org.apache.openjpa.jdbc.kernel.JDBCStoreManager.initialize(JDBCS toreManager.java:283) at com.ibm.ws.persistence.jdbc.kernel.WsJpaJDBCStoreManager.initial ize(WsJpaJDBCStoreManager.java:144)
Local fix
N/A
Problem summary
**************************************************************** * USERS AFFECTED: All users of the Java Persistence API 2.0 * * feature of the IBM ‚ ® WebSphere ‚ ® Applicat * Server V7 Feature Pack for OSGi * * Applications and Java Persistence API 2.0 * * who make use of WebSphere Application * * Server's implementation of the * * org.apache.openjpa.persistence.jdbc.Versi * * onStrategy. * **************************************************************** * PROBLEM DESCRIPTION: When using @VersionStrategy, generated * * SQL does not properly alias all * * parameters. * **************************************************************** * RECOMMENDATION: * **************************************************************** When WebSphere Application Server's implementation of VersionStrategy is used on an entity, and a 'find' is run to find the entity, Application Server generates the wrong SQL statement where one of the parameters in the SQL is not properly aliased. For example, if there is an entity name MY_ENTITY which has persistable fields ID, LAST_UPDATE, and COMMENTS, a proper SQL statement to find this entity might look something like this: SELECT t0.LAST_UPDATE, t0.COMMENTS FROM MY_ENTITY t0, WHERE t0.ID = ? However, an SQL is generated like this: SELECT LAST_UPDATE, t0.COMMENTS FROM MY_ENTITY t0, WHERE t0.ID = ? As can be seen, the 'LAST_UPDATE' parameter is not properly aliased with 't0'.
Problem conclusion
With this fix, code has been added to ensure parameters are properly aliased when VersionStrategy is used. The fix for this APAR is currently targeted for inclusion in Fix Pack 1.0.0.3 for Feature Pack for OSGi Applications and Java Persistence API 2.0. 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
PM23211
Reported component name
JPA OSGI FEATUR
Reported component ID
5724J0857
Reported release
700
Status
CLOSED PER
PE
NoPE
HIPER
NoHIPER
Special Attention
NoSpecatt
Submitted date
2010-09-24
Closed date
2010-09-29
Last modified date
2010-09-29
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
JPA OSGI FEATUR
Fixed component ID
5724J0857
Applicable component levels
R700 PSY
UP
[{"Business Unit":{"code":"BU053","label":"Cloud & Data Platform"},"Product":{"code":"SSEQTP","label":"WebSphere Application Server"},"Component":"","ARM Category":[],"Platform":[{"code":"PF025","label":"Platform Independent"}],"Version":"1.0","Edition":"","Line of Business":{"code":"LOB45","label":"Automation"}}]
Document Information
Modified date:
29 September 2020