-
Notifications
You must be signed in to change notification settings - Fork 3.6k
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
base: main
Are you sure you want to change the base?
Conversation
- 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>
There was a problem hiding this 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:
- This bug also affects
Session.findMultiple()
when passed a lock mode as aFindOption
, so we should test that too, since that's what we now recommend. - If you look at my commits on this issue, the bug also affected load by natural id, so we should test that too.
- I know that this is harder to test, but we really should test that the lock mode is actually affecting the generated SQL.
...nate-core/src/main/java/org/hibernate/loader/ast/internal/MultiIdEntityLoaderArrayParam.java
Show resolved
Hide resolved
...c/main/java/org/hibernate/loader/ast/internal/ExecutionContextWithSubselectFetchHandler.java
Show resolved
Hide resolved
...c/main/java/org/hibernate/loader/ast/internal/ExecutionContextWithSubselectFetchHandler.java
Show resolved
Hide resolved
hibernate-core/src/main/java/org/hibernate/loader/ast/internal/MultiIdEntityLoaderStandard.java
Show resolved
Hide resolved
hibernate-core/src/test/java/org/hibernate/orm/test/loading/multiLoad/MultiLoadLockingTest.java
Show resolved
Hide resolved
There was a problem hiding this 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.
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