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

Persistence improvements using hypersistence optimizer #10667

Merged
merged 5 commits into from
Nov 6, 2019
Merged

Persistence improvements using hypersistence optimizer #10667

merged 5 commits into from
Nov 6, 2019

Conversation

pmverma
Copy link
Member

@pmverma pmverma commented Oct 22, 2019

Fixes #10650
Fixes #10653

Please note that all are verified using the prod profile only.

  • Postgresql

  • Mysql

  • Mariadb

  • Mssql

  • Oracle

  • Please make sure the below checklist is followed for Pull Requests.

  • Travis tests are green

  • Tests are added where necessary

  • Documentation is added/updated where necessary

  • Coding Rules & Commit Guidelines as per our CONTRIBUTING.md document are followed

@Blackdread
Copy link
Contributor

For OneToOne, if MapsId is not used then on one side of the relationship (side without foreign key) will always be eager fetched, even if you put Lazy.

@pmverma
Copy link
Member Author

pmverma commented Oct 22, 2019

@Blackdread Yes you are correct. If it is bidirectional then there will be no effect. But for unidirectional, this will work.

Copy link
Member

@DanielFran DanielFran left a comment

Choose a reason for hiding this comment

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

LGTM

@DanielFran DanielFran merged commit 9c09521 into jhipster:master Nov 6, 2019
@pmverma
Copy link
Member Author

pmverma commented Nov 6, 2019

Thanks @DanielFran!

@pascalgrimaud pascalgrimaud added this to the 6.5.0 milestone Nov 10, 2019
@cbornet
Copy link
Member

cbornet commented Nov 12, 2019

There's a problem here : if we set the fetch strategy to be lazy at hibernate level, then it should be done at controller or service level. With the new behavior, if you call the REST endpoint for an entity, you don't see the related entity in the endpoint (it's null) and so it's not displayed in the front-end which is unexpected. It can even be very harmful : if you edit the entity then save without any modification, then the relationship is erased !

@pmverma
Copy link
Member Author

pmverma commented Nov 12, 2019

Thanks @cbornet for describing the problem. Actually yes, I generated and tested the PR by skipping the client during generation. I will check it.

@pmverma
Copy link
Member Author

pmverma commented Nov 13, 2019

For the moment, I will revert the lazy load. It is better to have a patch release for this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Update Mysql dialect to 8.0 JPA improvements using Hypersistence Optimizer
5 participants