Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 9122931
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T06:13:09+00:00 2026-06-17T06:13:09+00:00

A while back I asked a couple questions about Doctrine’s query cache as it

  • 0

A while back I asked a couple questions about Doctrine’s query cache as it did not work as I wanted it to.

Question about why my relationships weren’t being cached:

Doctrine result cache not caching a query with a join

Question about how to get relationships cached using detaching and merging:

Doctrine detaching, caching, and merging

I’m not sure why I didn’t do this sooner, but I just enabled Doctrine’s EchoSQLLogger and I found out that each page is doing three queries when I merge the entities back in.

My entites are user, company, and privilege, with user being the parent to the other two. When I first get the user with company and privilege joined, I run detach on the user and then put it in ApcCache. When I fetch from cache, I do a merge which gives me back the user entity with all of the Doctrine magic intact.

The problem is, when I call merge, it queries for the user, the company, and then privilege. Is this how merge is supposed to work?

Is there any way to cache my user entity with the two relationships intact without making calls to the database?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-17T06:13:10+00:00Added an answer on June 17, 2026 at 6:13 am

    To anyone (or myself) reading this in the future:

    I ended up working around the PHP Incomplete Class issue by doing separate queries and cache saves for each individual entity. For example my user/company/privilege dilemma in the question. I cache the user, cache the company and override $user['company'] with its results, and the same for privilege.

    This seems to work, but seriously. Doctrine’s caching needs help.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

So I asked a question a while back about securing downloads using C# (
A while back, I asked a question on here about how to run an
I noticed that a while back a question was asked about personal preferences in
A while back I asked a question about TransactionScope escalating to MSDTC when I
So a while back I asked a question here about matching a child of
So basically I asked this question while back: The query contains references to items
A while back, I asked about changing a MySQL query into Postgresql . And,
Similar to what I asked in this question a while back about getting the
I asked a question a while back about how to get the current variable
I asked a question a while back about the Maximum string length of Excel

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.