Unmapped attributes of superclass have wrong value [message #1386414] |
Tue, 17 June 2014 12:25 |
Stefan Loewe Messages: 2 Registered: June 2014 |
Junior Member |
|
|
Hi,
I have a problem with eclipselink 2.5.1. In 2.5.0, everything works fine.
Overview:
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.
Some details:
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"?>
<persistence version="2.0"
... i get into trouble when i try to post with the links here ...
>
<persistence-unit name="MyEJB or AnotherEJB" transaction-type="JTA">
<provider>org.eclipse.persistence.jpa.PersistenceProvider</provider>
<jta-data-source>jdbc/xxxx or jdbc/yyyy</jta-data-source>
<class>...MyVO or ...AnotherVO</class>
<exclude-unlisted-classes>true</exclude-unlisted-classes>
<properties>
<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" />
</properties>
</persistence-unit>
</persistence>
I observed the following:
Inside PersistenceObjectInstantiationPolicy#buildNewInstance() we have a call
return factory._persistence_new(factory);
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,
Stefan
|
|
|
|
Powered by
FUDForum. Page generated in 0.02771 seconds