[
https://issues.apache.org/jira/browse/OPENJPA-2252?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13436892#comment-13436892
]
Helen Xu commented on OPENJPA-2252:
-----------------------------------
The extra update is from the wrong checking in VersionAttachStrategy.attach to
determine if the attaching entity is new or not. When it calls the
BrokerImpl.isDetached, it returns false for the embedded field since it has no
pcIsDetached method after serialization and deserialzation plus there is no OID
for embedded field. The embedded field shouldn't be treated as new instance
when it has not null owner entity. With the change I posted, it fixed the
problem. I also added more test cases to make sure it doesn't break other
cases. All the other junit tests passed as well when I run "mvn clean install"
> Unexpected update statement when merging a serialized and no-change entity
> with the embedded field
> --------------------------------------------------------------------------------------------------
>
> Key: OPENJPA-2252
> URL: https://issues.apache.org/jira/browse/OPENJPA-2252
> Project: OpenJPA
> Issue Type: Bug
> Components: sql
> Affects Versions: 2.0.1, 2.1.1, 2.2.0, 2.3.0
> Reporter: Helen Xu
> Assignee: Helen Xu
> Attachments: OPENJPA-2252.patch
>
>
> The unexpected update statement was observed when merging a serialized and
> deserialized entity which has no change and contains the embedded field.
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators:
https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira