[
https://issues.apache.org/jira/browse/OPENJPA-3106?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=18155117#comment-18155117
]
ASF subversion and git services commented on OPENJPA-3106:
----------------------------------------------------------
Commit 0b4a2eba7b29d7cb97d88a05f49212a41ee9a9e5 in openjpa's branch
refs/heads/OPENJPA-3106 from Richard Zowalla
[ https://gitbox.apache.org/repos/asf?p=openjpa.git;h=0b4a2eba7 ]
Merge remote-tracking branch 'origin/master' into OPENJPA-3106
> Non-deterministic AttributeConverter makes an unchanged field dirty on every
> flush
> ----------------------------------------------------------------------------------
>
> Key: OPENJPA-3106
> URL: https://issues.apache.org/jira/browse/OPENJPA-3106
> Project: OpenJPA
> Issue Type: Bug
> Reporter: Richard Zowalla
> Priority: Minor
> Fix For: 4.3.0
>
>
> An AttributeConverter whose convertToDatabaseColumn() returns a different
> value for the same attribute on every call, for example an encrypting
> converter with a random IV or salt, makes OpenJPA see the field as changed on
> every flush. An unchanged instance is updated each time, and after a JPQL
> bulk DELETE (or native DELETE) removed its row, the next flush fails with an
> OptimisticLockException.
> This happens for enhanced entities too. The likely cause is the check of
> whole-converted fields (OPENJPA-3019, dirtyCheckWholeConverted), which
> compares the database values of the current attribute and the loaded one.
> Comparing the attribute values (or the value as last read from or written to
> the database) instead of converting again would avoid it.
> Found while reviewing OPENJPA-3104.
--
This message was sent by Atlassian Jira
(v10.3.26#10030026)