When I unmarshal an object and try to update it through Castor JDO, I get an
exception.
The problem is this:
1. Marshal an object to XML that is already in the database. (using
Marshaller and a jdo/xml mapping file)
2. At some later date, Unmarshal a new object from the XML (using
Unmarshaller and a jdo/xml mapping file)
3. Call db.update(unmarshalledObject) on the unmarshalled object instance in
a transaction (The element values in the XML may have been changed so we
want to update the object in the database)
Step 3 produces: org.exolab.castor.jdo.DuplicateIdentityException: Duplicate
identity found for object of type ObjectType with identity 10124092529591:
an object with the same identity already exists in persistent storage.
To get around this, I have to load the object from the database and map its
jdoTimeStamp property to the unmarshalled object. Then I can update the
unmarshalled object successfully. This is not a problem until my
unmarshalled object contains attributes that are collections of other
objects. When this occurs, I have to also map the collection's object's
jdoTimeStamp properties to the corresponding collection object in the object
I loaded from the database.
Any ideas on how to unmarshal and call update without having to map
jdoTimeStamps?
Thanks in advance!
rich
-----------------------------------------------------------
If you wish to unsubscribe from this mailing, send mail to
[EMAIL PROTECTED] with a subject of:
unsubscribe castor-dev