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

[incubator-kie-issues-1084] User eager fetching in ProcessDefinitionEntity to avoid transaction errors #2032

Merged
merged 1 commit into from
Apr 19, 2024

Conversation

martinweiler
Copy link
Contributor

@elguardian
Copy link
Contributor

I am not sure this is the best approach.
@fjtirado This happens when toString is invoked as it requires to load those lazy fields. If you have any other suggestion plz. go ahead.

@fjtirado
Copy link
Contributor

@martinweiler I think removing the three collections from toString method will be enough. Lets keep loading of collections lazy.
See https://struberg.wordpress.com/2016/10/15/tostring-equals-and-hashcode-in-jpa-entities/ for more rationale on that

@fjtirado fjtirado self-requested a review April 15, 2024 12:54
@@ -208,7 +209,6 @@ public String toString() {
", roles=" + roles +
", addons=" + addons +
", endpoint='" + endpoint + '\'' +
", nodes='" + nodes + '\'' +
Copy link
Contributor

@fjtirado fjtirado Apr 15, 2024

Choose a reason for hiding this comment

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

I think removing roles and addons from toString will do the trick
Im wondering if to string should just print the id and the version (the composite key) of the process definition to avoid further problem. That will be enough for logging

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@fjtirado ok, let's just remove the fields that are lazy loaded from the toString method

…y.toString to avoid transaction errors due to lazy loading
@martinweiler martinweiler force-pushed the incubator-kie-issues-1084 branch from 5a4faca to bbfdfbb Compare April 17, 2024 21:11
@elguardian elguardian merged commit 4a8847d into apache:main Apr 19, 2024
4 of 5 checks passed
rgdoliveira pushed a commit to rgdoliveira/kogito-apps that referenced this pull request Apr 23, 2024
…y.toString to avoid transaction errors due to lazy loading (apache#2032)
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.

Application using data-index persistence fails or hangs with debug level logging enabled
4 participants