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

Add force parameter to retrieve object directly from database #639

Closed

Conversation

croitoruion
Copy link
Contributor

The object from the database should be retrieved using the force parameter. Currently, it can be fetched from the cache, which may result in outdated (cached) data.
We encountered a bug where the system returns a draft version of objects instead of the latest saved version. This happens because $objectFromDatabase is compared to a cached previous version, not the actual version from the database.
Adding the force parameter ensures the object is fetched directly from the database.
image

Copy link

github-actions bot commented Jul 30, 2024

CLA Assistant Lite bot All contributors have signed the CLA ✍️ ✅

Copy link

sonarcloud bot commented Jul 30, 2024

@croitoruion
Copy link
Contributor Author

I have read the CLA Document and I hereby sign the CLA

@mhgtlc
Copy link
Contributor

mhgtlc commented Aug 15, 2024

@brusch @wisconaut can you please merge this PR?

@fashxp
Copy link
Member

fashxp commented Aug 16, 2024

Could you please outline more in detail what happened on your end?
Fetching data from DB will affect performance and at least in theory, the cached data should always be up-to-date. So probably there is another reason for that problem?

@fashxp
Copy link
Member

fashxp commented Aug 27, 2024

🏓 @mhgtlc @croitoruion

@fashxp
Copy link
Member

fashxp commented Sep 16, 2024

@mhgtlc @croitoruion any updates?

@croitoruion
Copy link
Contributor Author

@mhgtlc @croitoruion any updates?

We updated the Redis clusters and cleared all Pimcore caches, and the problem disappeared. I believe we encountered a very edge case. We're considering that when retrieving an object from the database, it should be freshly fetched and that fixed the problem we faced, understanding that this may affect performance.
We can close this PR for now.
Thanks

@lukmzig
Copy link
Contributor

lukmzig commented Sep 17, 2024

@croitoruion thank you very much for the clarification. Closing the PR based on your comment 👍

@lukmzig lukmzig closed this Sep 17, 2024
@github-actions github-actions bot locked and limited conversation to collaborators Sep 17, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants