Issues
- Metamodel imports cache increases indefinitely for dynamically generated HQL aliases eventually leading to an OOMHHH-14948Resolved issue: HHH-14948Ivaylo Mitrev
- Error calling Function()HHH-14766Resolved issue: HHH-14766Christian Beikov
- No Dialect mapping for JDBC type: AttributeConverter and OffsetDateTimeHHH-14042
- Allow NamedQuery to set hint QueryHints.PASS_DISTINCT_THROUGHHHH-13780Resolved issue: HHH-13780
- Hibernate tries to flush @Immutable entityHHH-13702
- auto-applied AttributeConverter isn't created by CDIHHH-13693
- NPE on flushing when ElementCollection field contains null elementHHH-13651Resolved issue: HHH-13651Yosef Yona
- Persistence.createEntityManagerFactory(Map) should allow dynamic specification of jta datasourceHHH-13646Resolved issue: HHH-13646
- Bugs join-fetching a collection when scrolling with a stateless session using enhancement as proxyHHH-13633Resolved issue: HHH-13633Former user
- Hibernate + JCache does not remove entites from cache when entity is removedHHH-13632
- Exception if spaces after value of javax.persistence.schema-generation.scripts.action in hibernate.propertiesHHH-13621Resolved issue: HHH-13621Andrea Boriero
- Metamodel is empty for embeddables without gettersHHH-13620Resolved issue: HHH-13620Gavin King
- Persist fails when using JOINED Inheritance with batch_size > 1 and legacy ID generationHHH-13617
13 of 13
caches failed imports (with an empty string instance) in
MetamodelImpl
with the intention of avoiding exceptions every time an unknown class name reachesMetamodelImpl#getImportedClassName
.My experience with Hibernate, however, shows that the target entity being joined with is also sent to said method.
For example, in the following HQL query:
e.relatedEntity
will be passed togetImportedClass
asprocess
will evaluate to true (e is a valid Java identifier and the surrounding tokens also pass the validation). That’s probably not an issue for hard-coded queries for which the join target will always remaine.relatedEntity
and which would lead to adding just this one additionale.relatedEntity --> ””
node to the map.The problem for us, however, is that our application dynamically generates random aliases in HQL queries (due to these queries being dynamically built). Such dynamically generated entity aliases end up being added to the imports map with an empty string value. As a result, the
imports
map inMetamodelImpl
constantly grows, eventually leading to an OOM for our applications as this isn't session-specific cache and as I have not been able to find any way of clearing the failed imports.I could not find any information in the documentation stating that our approach with dynamic aliases is incorrect and decided to raise a ticket considering the severity of the issue for us. I would assume that either failed imports need not be cached after all (for memory reasons) or this method need not be invoked for them.
PR: