[eclipselink-dev] JPA Entity Manager Backup Clone Problem By Using SDO
Hi EclipseLink Team,
In our SDO
service project we some problems to use JPA with SDO class
SDO classes to retrieve database data by JPA causes wrong values for related
objects (mapped by ONE-TO-ONE or ONE-TO-MANY).
We have created an example eclipse project 'AddressBook-JPA-SDO' to
simulate / demonstrate the problem / fault.
are three entities: Person, Address and Phone. The Person entity
contains the attribute address (Address.class mapped by
The Phone entity is related to Person as the attribute
phoneList (Phone.class mapped by one-to-many). All entity
classes are implemented as SDODataObject.
we try to read the data by the root entity Person, the related Address
object is retuned by null (finally). Also the Phone list object is
corrupted. The list contains the same amount of objects like they are stored in
the database, but the their class type isn't correct. The contend of the
Phone list is set to the type Person.
By debugging the EclipseLink data
load process, we recognized that all backup cloning for
one-to-one and one-to-many related attributes retuning the clone
object of the working copy (previous clone). This is designed the
method buildBackupCloneForPartObject() in the classes
set the Person descriptor to read-_only_=true, the backup clone will not be
created and the data of Person, Address and Phone (list) will be returned/loaded
this prevents update and create processing of the Person, Address and
Phone by the entity manager.
use POJOs everything works fine (see project 'AddressBook-Session-XML'. But we
have to implement SDO objects on our service project and won't design a special
layer / process to merge POJO data with SDO data.
Do You have an idea / suggestion to solve this problem?
Do You think SDO object
persistency problem just a fixable issue or there are some fundamental design
Andrei Shakirin, Robert
the attachment contents :
AddressBook(Derby-Database).zip // Apache Derby Database 10.2.4
contains test data of Person, Address, Phone
AddressBook(JPA-Session-XML).zip // Eclipse JPA Project using POJOs (EclipseLink
- AddressBook(JPA-SDO).zip //
Eclipse JPA Project using SDO (EclipseLink project.xml
- Eclipse Ganymede (3.4) (incl.
- EclipseLink 1.1-SNAPSHOT