APAR status
Closed as program error.
Error description
OpenJPA is calling https://docs.oracle.com/javase/7/docs/api/java/sql/ResultSet.htm l#getBlob(int), but then, if an SQLException is thrown, OpenJPA attempts to call https://docs.oracle.com/javase/7/docs/api/java/sql/ResultSet.htm l#getBytes(int)! This call to getBytes() then works successfully and everything is fine. The issue here is that OpenJPA is using a possible SQLException, thrown from the jdbc layer, as logic to know what the right method to invoke is! That bad for us because we log an FFDC on getBlob(), even tho there was no issue. The fix for this will be to update OpenJPA to change the logic to be more precise in their decision on which method to invoke. This should remove the false FFDC to be thrown. Please open an APAR for this issue and I will deliver the fix to OpenJPA, targeting the fix for the next WAS release.
Local fix
N/A
Problem summary
**************************************************************** * USERS AFFECTED: All users of IBM WebSphere Application * * Server Liberty - Java Persistence APA - * * JPA 2.0 & OpenJPA * **************************************************************** * PROBLEM DESCRIPTION: OpenJPA creates an extraneous FFDC * * exception when running on DB2 * **************************************************************** * RECOMMENDATION: * **************************************************************** When executing a query on DB2, if the query contains @Lob with columnDefinition that contains 'FOR BIT DATA', OpenJPA will cause an FFDC to become generated. However, this exception is extraneous since OpenJPA is supposed to be consuming the exception without any real issue. Entity: @Entity public class ByteArrayHolder { ... @Lob @Column(columnDefinition="CHAR(16) FOR BIT DATA NOT NULL") private byte[] tkiid; ... } Test: byte[] ba = new byte[]{(byte)0xa0, (byte)0x1b, (byte)0x01, (byte)0x1f, (byte)0x38, (byte)0xcf, (byte)0x67, (byte)0x35, (byte)0x55, (byte)0x43, (byte)0xd9, (byte)0xf6, (byte)0x71, (byte)0x5e, (byte)0x00, (byte)0x00}; ByteArrayHolder holder = new ByteArrayHolder(); holder.setTkiid(ba); em.getTransaction().begin(); em.persist(holder); em.getTransaction().commit(); Error: FFDC Exception:com.ibm.db2.jcc.am.SqlSyntaxErrorException SourceId:com.ibm.ws.rsadapter.jdbc.WSJdbcResultSet.getBlob ProbeId:754 Reporter:com.ibm.ws.rsadapter.jdbc.WSJccResultSet@a35b6d30 com.ibm.db2.jcc.am.SqlSyntaxErrorException: [jcc][t4][1092][11643][4.19.49] Invalid data conversion: Wrong result column type for requested conversion. ERRORCODE=-4461, SQLSTATE=42815 at com.ibm.db2.jcc.am.kd.a(Unknown Source) at com.ibm.db2.jcc.am.kd.a(Unknown Source) at com.ibm.db2.jcc.am.kd.a(Unknown Source) at com.ibm.db2.jcc.am.mc.V(Unknown Source) at com.ibm.db2.jcc.am.ResultSet.getBlob(Unknown Source) at com.ibm.ws.rsadapter.jdbc.WSJdbcResultSet.getBlob(WSJdbcResultSe t.java:739) at org.apache.openjpa.lib.jdbc.DelegatingResultSet.getBlob(Delegati ngResultSet.java:588) at org.apache.openjpa.jdbc.sql.DBDictionary.getBlob(DBDictionary.ja va:667) at org.apache.openjpa.jdbc.sql.DB2Dictionary.getBytes(DB2Dictionary .java:1032) at org.apache.openjpa.jdbc.sql.ResultSetResult.getBytesInternal(Res ultSetResult.java:290) at org.apache.openjpa.jdbc.sql.ResultSetResult.getObjectInternal(Re sultSetResult.java:425)
Problem conclusion
The fix for this APAR changes the OpenJPA implementation and involves an update to the thirdparty source. See https://issues.apache.org/jira/browse/OPENJPA-2745 This fix is currently targeted for WebSphere Application Server 9.0.0.9, 8.5.5.15, and WebSphere Liberty 18.0.0.3. 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
PH02108
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
2018-08-23
Closed date
2018-09-20
Last modified date
2018-09-20
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
R900 PSY
UP
[{"Business Unit":{"code":"BU059","label":"IBM Software w\/o TPS"},"Product":{"code":"SSEQTP","label":"WebSphere Application Server"},"Platform":[{"code":"PF025","label":"Platform Independent"}],"Version":"8.5","Line of Business":{"code":"LOB45","label":"Automation"}}]
Document Information
Modified date:
01 November 2021