Repository navigation
Conversation
…uals A converter that converts the same value differently on each call made an attribute converted as a whole dirty at every flush. Compare it with the value converted back from the saved column value instead. CompareConvertedValuesByEquals=false restores the previous behaviour. Generated-by: Claude Code (Opus 5.5)
# Conflicts: # openjpa-project/src/docs/asciidoc/migration_considerations.adoc
rzo1
marked this pull request as ready for review
December 4, 2026 06:32
solomax
approved these changes
Dec 4, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
https://issues.apache.org/jira/browse/OPENJPA-3106
An
AttributeConverterthat returns a different column value for the same attribute on each call (e.g. encryption with a random salt or IV) made an attribute converted as a whole (a collection, a map or an object) dirty at every flush. An unchanged instance was updated each time, and after a JPQL bulk or nativeDELETEremoved its row the next flush failed with anOptimisticLockException. This affected enhanced entities too.Cause: the OPENJPA-3019 check compares the column value saved at load or flush with a fresh
convertToDatabaseColumn()of the current attribute.Fix (
StateManagerImpl.isWholeConvertedChanged, used by the flush check, merge, the data cache and the rollback restore):equals(), as Hibernate does.Behaviour change: a change made in place to state that
equals()of the attribute type (or of its elements) does not cover is no longer written for such converters.openjpa.Compatibility=CompareConvertedValuesByEquals=falsewrites these attributes at every flush as before. Documented in the 4.3.0 migration considerations and the upgrade notes.Not covered: a type without
equals()behind such a converter is still written at every flush.Tests:
TestNonDeterministicConverter(13),TestNonDeterministicConverterDataCache(1),TestNonDeterministicObjectConverterEquals(6, default) andTestNonDeterministicObjectConverter(3, option off). The OPENJPA-3019 tests (TestConvertedInPlaceChange) and allTestConverted*pass.