Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
[eclipselink-dev] Q: FetchPan Extension and JPQL Query Cache

Committers,
 
I have been working with some customers on the http://wiki.eclipse.org/EclipseLink/Development/Incubator/Extensions/FetchPlan extension incubator. This functionality uses a QueryRedirector to post process a query forcing specified relationships to be instantiated so that the resulting entities are available to serialize with the required depth of relationships. The extension also stores the FetchPlan within the native query using its properties.
 
The challenge I am running into is that our JPQL based query cache stores native queries based on the JPQL string used to create them. If you then modify the state of the native query by unwrapping it from the JPA query instance you are in fact modifying the cached native query. This means that the subsequent EntityManager.createQuery("...") calls with the same JPQL string will get the cached native query with the previous configurations applied which  means we are leaking config between query executions.
 
Before filing bugs on the issue I wanted to figure out who knows this code best and can help me work-around it effectively in the shipped versions and what we should be doing going forward.
 
Q1: Is there a way to avoid using the query cache when requesting the query's creation?
 
Q2: Is there a recommended way to avoid corrupting the query cache when modifying the native query?
 
Doug
 

Back to the top