Uploaded image for project: 'Hibernate ORM'
  1. HHH-9895

QueryTranslatorImpl makes invalid class resolutions

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major
    • Resolution: Rejected
    • Affects Version/s: None
    • Fix Version/s: None
    • Component/s: hibernate-core
    • Labels:
      None
    • Bug Testcase Reminder (view):

      Bug reports should generally be accompanied by a test case!

    • Last commented by a user?:
      true
    • Sprint:

      Description

      When performing JPA Criteria queries, there are many calls to ReflectHelper.getConstantValue with values like "generatedAlias0", which in turn attempts to load the class "generatedAlias0". This naturally fails, but resolving the class and throwing/cachting the exception is quite expensive in terms of cpu performance. No such calls should be made.

      Thread [main] (Suspended (breakpoint at line 191 in ReflectHelper))
      owns: QueryTranslatorImpl (id=8378)
      ReflectHelper.classForName(String) line: 191
      ReflectHelper.getConstantValue(String) line: 279
      QueryTranslatorImpl$JavaConstantConverter.handleDotStructure(AST) line: 624
      QueryTranslatorImpl$JavaConstantConverter.visit(AST) line: 619
      NodeTraverser.visitDepthFirst(AST) line: 78
      NodeTraverser.traverseDepthFirst(AST) line: 67
      QueryTranslatorImpl.parse(boolean) line: 300
      QueryTranslatorImpl.doCompile(Map, boolean, String) line: 203
      QueryTranslatorImpl.compile(Map, boolean) line: 158
      HQLQueryPlan.<init>(String, String, boolean, Map<String,Filter>, SessionFactoryImplementor, EntityGraphQueryHint) line: 131
      HQLQueryPlan.<init>(String, boolean, Map<String,Filter>, SessionFactoryImplementor) line: 93
      QueryPlanCache.getHQLQueryPlan(String, boolean, Map<String,Filter>) line: 167
      SessionImpl(AbstractSessionImpl).getHQLQueryPlan(String, boolean) line: 301
      SessionImpl(AbstractSessionImpl).createQuery(String) line: 236
      SessionImpl.createQuery(String) line: 1800
      EntityManagerImpl(AbstractEntityManagerImpl).createQuery(String, Class<T>, Selection, QueryOptions) line: 568
      CriteriaQueryImpl$1.buildCompiledQuery(HibernateEntityManagerImplementor, InterpretedParameterMetadata) line: 336
      CriteriaCompiler.compile(CompilableCriteria) line: 147
      EntityManagerImpl(AbstractEntityManagerImpl).createQuery(CriteriaQuery<T>) line: 736

        Attachments

          Activity

            People

            • Votes:
              0 Vote for this issue
              Watchers:
              5 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: