Skip to content

Conversation

gtoison
Copy link
Contributor

@gtoison gtoison commented Nov 27, 2024

Test reproducing the issue: https://hibernate.atlassian.net/browse/HHH-18885
Putting a entity in an extra lazy map and committing the transaction results in a ClassCastException


By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license
and can be relicensed under the terms of the LGPL v2.1 license in the future at the maintainers' discretion.
For more information on licensing, please check here.


Copy link
Member

@mbellade mbellade left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actually, since AbstractPersistentCollection is also an SPI, I'd rather add the method with the correct signature even in 6.6.

@mbellade mbellade changed the title HHH-18885 test reproducing the issue HHH-18885 Introduce DelayedOperation.getAddedEntry() for maps Oct 2, 2025
Extra lazy maps need to persist the added entry (key and value), not the
added value.
Let PersistentMap.AbstractMapValueDelayedOperation return the added
entry so
OneToManyPersister.writeIndex() can execute the queued operation.
Copy link
Member

@mbellade mbellade left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @gtoison - we'll merge this once we have a few bug fixes ready for 6.6

@mbellade mbellade merged commit bd63ded into hibernate:6.6 Oct 3, 2025
21 of 25 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants