[Hibernate-JIRA] Created: (HHH-3383) QueryKey is storing references to entities instead of identifiers
by Manuel Dominguez Sarmiento (JIRA)
QueryKey is storing references to entities instead of identifiers
-----------------------------------------------------------------
Key: HHH-3383
URL: http://opensource.atlassian.com/projects/hibernate/browse/HHH-3383
Project: Hibernate3
Issue Type: Improvement
Components: caching (L2)
Affects Versions: 3.3.0.CR1
Environment: ehcache 1.5.0b2
Reporter: Manuel Dominguez Sarmiento
Context: query caching
Hibernate is storing full entity references when building QueryKeys and the query has restrictions which reference entities. This happens either with Criteria or HQL queries.
Although this is not incorrect, when the referenced entities reference in turn "heavy" object graphs, this causes a very significant memory usage increase, since references to detached entities will remain in the cache. This is even more evident when using disk persistence with ehcache, since the full object graphs are serialized to disk.
This could be easily improved (correct me if I'm wrong) by storing ONLY entity identifiers in the QueryKey instead of full entities, since all the query really needs is the identifier property. The memory usage would decrease dramatically.
So far the workaround we've found is explicitly using restrictions that reference identifiers instead of properties in HQL queries, however this is not particularly elegant, and still leaves open the issue with Criteria queries. The same cannot be done without criteria.createCriteria() which generates an unnecessary join in most cases.
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://opensource.atlassian.com/projects/hibernate/secure/Administrators....
-
For more information on JIRA, see: http://www.atlassian.com/software/jira
13 years
[Hibernate-JIRA] Created: (METAGEN-58) Subsequent processing rounds are trying to reprocess Entities that are already processed, this causes an error.
by Viet Trinh (JIRA)
Subsequent processing rounds are trying to reprocess Entities that are already processed, this causes an error.
---------------------------------------------------------------------------------------------------------------
Key: METAGEN-58
URL: http://opensource.atlassian.com/projects/hibernate/browse/METAGEN-58
Project: Hibernate Metamodel Generator
Issue Type: Bug
Components: processor
Affects Versions: 1.1.1.Final
Environment: jdk1.6.0_23, Eclipse 3.6, Maven 2, Hibernate version 3.6.1.Final, MS SQL 2005.
Reporter: Viet Trinh
Assignee: Hardy Ferentschik
Priority: Minor
I have an entity named "Car" and another processor that creates another entity name "CarAudit".
After the first round, the class "Car_" and class "CarAudit" are created, therefore causing a subsequent round of processing since "CarAudit" is marked with @Entity.
However, the second round fails with the following error:
"diagnostic error: Problem with Filer: Attempt to recreate a file for type com.example.Car_"
This is due to not clearing the "metaEntities" list from the context object after every round. Each processing round will use the same processor and context object and try to create all of the meta entries listed in the context during each round.
My proposed solution is to clear the metaEntities list from the context object after each round of processing.
Sorry, I do not have a test case for this right now.
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://opensource.atlassian.com/projects/hibernate/secure/Administrators....
-
For more information on JIRA, see: http://www.atlassian.com/software/jira
13 years