hibernate-orm icon indicating copy to clipboard operation
hibernate-orm copied to clipboard

HHH-14244 Force dirty mark on write to uninitialized lazy property

Open pludov opened this issue 5 years ago • 5 comments

The generated field writer method is modified.

I added a check to detect an uninitialized lazy field and force marking it dirty. But that check is only usefull when the new value is the default for the type (null/0/false...). For other values, the existing comparison is enough to mark the dirty. So, the new code is only triggered when received the default value, to avoid doing the check too frequently

pludov avatar Oct 01 '20 18:10 pludov

Usually PR is targeting master branch rather than some specific version branch, so when it is merged to master, core team member can determine whether to back port to 5.4 or not, in addition to merging to current 5.5 branch.

NathanQingyangXu avatar Oct 01 '20 18:10 NathanQingyangXu

@Sanne @dreab8 It seems there is some good stuff here. Could you take a look when you have time?

NathanQingyangXu avatar Oct 01 '20 19:10 NathanQingyangXu

Usually PR is targeting master branch rather than some specific version branch, so when it is merged to master, core team member can determine whether to back port to 5.4 or not, in addition to merging to current 5.5 branch.

I was primarly interested on 5.4, so... :-) However, the branch applies verbatim on master and gradle build is ok as well.

pludov avatar Oct 02 '20 08:10 pludov

Usually PR is targeting master branch rather than some specific version branch, so when it is merged to master, core team member can determine whether to back port to 5.4 or not, in addition to merging to current 5.5 branch.

I was primarly interested on 5.4, so... :-) However, the branch applies verbatim on master and gradle build is ok as well.

well, targeting master branch is more future-proof, :). Also, it would motive code reviewers much more as a generic patch, as opposed to a branch patch only.

NathanQingyangXu avatar Oct 02 '20 12:10 NathanQingyangXu

Many thanks @pludov , this seems a rather important fix, but I'm rusty on ASM. I need to set aside some proper review time next week.

Sanne avatar Oct 02 '20 12:10 Sanne