Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

HHH-18992 - Locking does not work with multiLoad #9681

Open
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

jrenaat
Copy link
Member

@jrenaat jrenaat commented Jan 28, 2025


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.


https://hibernate.atlassian.net/browse/HHH-18992

wanderer2097 and others added 3 commits January 28, 2025 23:18
- added an @AfterEach tearDown method
- the testMultiLoadSimpleIdEntityPessimisticWriteLockSomeInL1CAndSomeInL2C was missing the enableSessionCheck(true) setting
- removed the tests that use optimistic/optimistic_force_increment since these modes are only legal for versioned entities

Signed-off-by: Jan Schatteman <jschatte@redhat.com>
Signed-off-by: Jan Schatteman <jschatte@redhat.com>
@jrenaat jrenaat requested review from gavinking and mbladel January 28, 2025 22:51
Copy link
Member

@gavinking gavinking left a comment

Choose a reason for hiding this comment

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

Thanks, @jrenaat!

I have left some very minor suggestions.

But on the test side of things, I have this additional feedback:

  1. This bug also affects Session.findMultiple() when passed a lock mode as a FindOption, so we should test that too, since that's what we now recommend.
  2. If you look at my commits on this issue, the bug also affected load by natural id, so we should test that too.
  3. I know that this is harder to test, but we really should test that the lock mode is actually affecting the generated SQL.

Copy link
Member

@mbladel mbladel left a comment

Choose a reason for hiding this comment

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

Few minor comments, but the fix looks great!

Though not strictly necessary, it would be nice if you could also apply the correct code-style to the test class.

Edit: looks like @gavinking beat me to this, I agree it would be great to add more tests and perhaps the fixes could be similar.

@jrenaat jrenaat mentioned this pull request Jan 30, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants