Lazy properties are not updated if not all lazy properties are initialized
Description
Activity
Show:

Jörg Mattes February 21, 2017 at 11:51 AM
Hi Petras, fyi: I had to open another issue (), because was closed, but the bug still persists.

Petras October 5, 2016 at 10:45 AM
Thank you, Jörg, for reopening the issue, I had no time to prepare the test case myself. Sorry.

Jörg Mattes October 5, 2016 at 10:36 AM
I opened HHH-11155, to be able to upload the testcase.

Jörg Mattes October 3, 2016 at 2:39 PM
I am having the same problem, and as far as I can see this issue is not really a duplicate of and thus not resolved.
I have a runnable testcase, put no permissions to attach it. Should I open a new issue and attach it there? Otherwise I need the permissions to upload an attachment.

Former user June 22, 2016 at 8:43 PM
Please attach a runnable test case that reproduces your issue. The test code at https://github.com/hibernate/hibernate-test-case-templates can be used to create a runnable test case.
I have instrumented entity class with 2 lazy properties and
@ManyToMany
lazy association:If I update any lazy property (
encodedCertificate1
orencodedCertificate2
), Hibernate does not update it to database - it executes UPDATE, but without including the column(s) of updated property.Update occurs only if I initialize all lazy properties:
encodedCertificate1
,encodedCertificate2
andhkvDocuments
.The culprit seems to be in AbstractEntityPersister#update method where it gets SQL update statements from
getUpdateStrings()
method (and accordingly the property list to use from methodgetPropertyUpdateability()
) based on whether all lazy properties were initialized.