|Unmapped attributes of superclass have wrong value [message #1386414]
||Tue, 17 June 2014 12:25
| Stefan Loewe
Registered: June 2014
I have a problem with eclipselink 2.5.1. In 2.5.0, everything works fine.
When reading an object from the DB, one of its (unmapped) attributes does not get its default value.
When debugging the problem, I was able to follow the execution until the method buildNewInstance() in internal.descriptors.PersistenceObjectInstantiationPolicy. The debugger could not dig further into that method.
we want to read an instance of the entity MyVO from the DB. MyVO extends an abstract class BaseVO which defines the private attribute 'existing'. This attribute is not mapped to the DB and has default value true:
private boolean existing = true;
But when eclipselink returns MyVO, the value of existing is 'false'.
Strange enough, when reading AnotherVO from the DB, which also extends BaseVO, the attribute 'existing' has the correct value 'true'.
The difference between MyVO and AnotherVO is, that they live in different EJB jars, so I suspected a different configuration in persistence.xml. However, the configurations are as identical as they can be:
<?xml version="1.0" encoding="UTF-8"?>
... i get into trouble when i try to post with the links here ...
<persistence-unit name="MyEJB or AnotherEJB" transaction-type="JTA">
<jta-data-source>jdbc/xxxx or jdbc/yyyy</jta-data-source>
<class>...MyVO or ...AnotherVO</class>
<property name="eclipselink.cache.shared.default" value="false" />
<property name="eclipselink.jdbc.bind-parameters" value="true" />
<property name="eclipselink.persistence-context.flush-mode" value="commit" />
<property name="eclipselink.persistence-context.reference-mode" value ="WEAK" />
<property name="eclipselink.target-database" value="org.eclipse.persistence.platform.database.oracle.Oracle11Platform"/>
<property name="eclipselink.target-server" value="WebSphere" />
<property name="eclipselink.weaving" value="dynamic" />
I observed the following:
Inside PersistenceObjectInstantiationPolicy#buildNewInstance() we have a call
where 'factory' is a sort of MyVO (or AnotherVO). In 'factory', the value of 'existing' is set correctly to 'true'.
When weaving is switched off for the persistence unit 'MyEJB', the error disappears.
Since eclipselink 2.5.0 works fine, I would like to ask whether you have an idea how I could make eclipselink 2.5.1 working for me.
Thank you and best regards,
Powered by FUDForum
. Page generated in 0.01754 seconds