APAR status
Closed as program error.
Error description
When the EntityManager.merge operation is applied to a class extending a mapped superclass, an exception is not thrown. For example, a testSimple() method persists a new instance of class Simple and subsequently merges another new instance of class Simple under the same id. Simple extends MapSup, which is a mapped superclass. This should fail, generating an exception similar to the following... Caused by: <openjpa-2.0.2-SNAPSHOT-r422266:1415037M fatal store error> org.apache.openjpa.persistence.EntityExistsException: FailedObject: test.ibm.Simple@4eeb4eeb at org.apache.openjpa.kernel.BrokerImpl.newFlushException(BrokerImp l.java:2305) at org.apache.openjpa.kernel.BrokerImpl.flush(BrokerImpl.java:2142) Instead, no exception is thrown and the merge is successful.
Local fix
Problem summary
**************************************************************** * USERS AFFECTED: All users of IBM WebSphere Application * * Server Liberty Profile * **************************************************************** * PROBLEM DESCRIPTION: MappedSuperClass without an @Id causes * * wrong identity type for the inherited * * types. * **************************************************************** * RECOMMENDATION: * **************************************************************** A MappedSuperClass without a declared identity field can cause the derived classes that have declared an @Id field to incorrectly use the wrong identity type because the identity type of its superclass is unknown. This leads to the derived type using the default identity type. As an exmaple of this case, take the following very simple MappedSuperclass: @MappedSuperclass public class MappedSuperWithoutId { private String description; public String getDesc() { return description; } public void setDesc(String desc) { this.description = desc; } } With the above MappedSuperclass, take the following JPA Entity: @Entity public class DerivedEntityFromMappedSuperWithoutId extends MappedSuperWithoutId { @Id private long id;
Problem conclusion
With this fix, code has been added to OpenJPA to properly handle an identity field declared in a derived class, rather than the mapped super class. The fix for this APAR is currently targeted for inclusion in fix pack 8.5.5.1. 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
PM93344
Reported component name
LIBERTY PROFILE
Reported component ID
5724J0814
Reported release
850
Status
CLOSED PER
PE
NoPE
HIPER
NoHIPER
Special Attention
NoSpecatt
Submitted date
2013-07-18
Closed date
2013-09-12
Last modified date
2013-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
LIBERTY PROFILE
Fixed component ID
5724J0814
Applicable component levels
R850 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":"850","Edition":"","Line of Business":{"code":"LOB45","label":"Automation"}}]
Document Information
Modified date:
12 September 2013