-
-
Notifications
You must be signed in to change notification settings - Fork 966
7.0.x Bug - Don't call a resource constructor until GORM has been initialized by Spring #15195
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
base: 7.1.x
Are you sure you want to change the base?
7.0.x Bug - Don't call a resource constructor until GORM has been initialized by Spring #15195
Conversation
Not compatible with Gradle 8
…ix-forked-solution-4 use default parameter
Forge updates
Added platform-specific Docker commands for macOS/Linux and Windows to the verification section. Updated reference to the appendix with a markdown link for better navigation.
|
@matrei if you recall, we did this but I think it is best to keep resource a
Also, I found it unnecessary to instantiate an instance if we separate |
| class GormService<T extends GormEntity<T>> { | ||
|
|
||
| GormAllOperations<T> resource | ||
| private GormAllOperations<T> gormStaticApi |
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.
This field is now private, while it was public before. This is a breaking change for a non-major release ...
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.
@jdaugherty this is something that is not documented that nobody uses, but I have no problem removing private. done.
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.
From what I can tell, there was no gormStaticApi property before this change, so it should be private as it is lazily instantiated in the getter.
However, the resource property has changed type, which is breaking.
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.
Is there a reason we renamed the field?
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.
but I think it is best to keep resource a Class for 2 reasons:
@matrei @jdaugherty I explained my rational for the name change in the comment above
| class GormService<T extends GormEntity<T>> { | ||
|
|
||
| GormAllOperations<T> resource | ||
| private GormAllOperations<T> gormStaticApi |
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.
From what I can tell, there was no gormStaticApi property before this change, so it should be private as it is lazily instantiated in the getter.
However, the resource property has changed type, which is breaking.
The Problem
This is only an issue during a Spring Dev Tools restart, but this fixes the issue.
results in a domain object instantiation during the constructor, which:
The Fix
Lazy initialize the resource