Project:
View Revisions: Issue #37115 | [ Back to Issue ] | ||
Summary | 0037115: HQL constant parsing causes contention | ||
Revision | 2017-10-27 15:14 by alostale | ||
Steps To Reproduce | Execute attached test case profiling monitor locks -Check there is huge contention at: java.lang.Thread.State: BLOCKED at org.apache.catalina.loader.WebappClassLoaderBase.loadClass(WebappClassLoaderBase.java:1200) - waiting to lock <334e3ea4> (a java.lang.Object) owned by "ajp-nio-8009-exec-46" t@125 at org.apache.catalina.loader.WebappClassLoaderBase.loadClass(WebappClassLoaderBase.java:1167) at org.hibernate.util.ReflectHelper.classForName(ReflectHelper.java:187) at org.hibernate.util.ReflectHelper.getConstantValue(ReflectHelper.java:266) at org.hibernate.hql.ast.QueryTranslatorImpl$JavaConstantConverter.handleDotStructure(QueryTranslatorImpl.java:599) at org.hibernate.hql.ast.QueryTranslatorImpl$JavaConstantConverter.visit(QueryTranslatorImpl.java:594) at org.hibernate.hql.ast.util.NodeTraverser.visitDepthFirst(NodeTraverser.java:78) at org.hibernate.hql.ast.util.NodeTraverser.traverseDepthFirst(NodeTraverser.java:66) at org.hibernate.hql.ast.QueryTranslatorImpl.parse(QueryTranslatorImpl.java:280) at org.hibernate.hql.ast.QueryTranslatorImpl.doCompile(QueryTranslatorImpl.java:182) - locked <56ccf607> (a org.hibernate.hql.ast.QueryTranslatorImpl) at org.hibernate.hql.ast.QueryTranslatorImpl.compile(QueryTranslatorImpl.java:136) at org.hibernate.engine.query.HQLQueryPlan.<init>(HQLQueryPlan.java:101) at org.hibernate.engine.query.HQLQueryPlan.<init>(HQLQueryPlan.java:80) at org.hibernate.engine.query.QueryPlanCache.getHQLQueryPlan(QueryPlanCache.java:124) at org.hibernate.impl.AbstractSessionImpl.getHQLQueryPlan(AbstractSessionImpl.java:156) at org.hibernate.impl.AbstractSessionImpl.createQuery(AbstractSessionImpl.java:135) at org.hibernate.impl.SessionImpl.createQuery(SessionImpl.java:1770) |
||
Revision | 2017-10-19 14:13 by alostale | ||
Description | With high concurrency contention at JVM level occurs when Hibernate is creating AST tree for queries at at org.hibernate.util.ReflectHelper.classForName(ReflectHelper.java:187) at org.hibernate.util.ReflectHelper.getConstantValue(ReflectHelper.java:266) This is caused because HQL allows to include Java constant values, to determine whether a token is or not a constant it performs a classForName whenever it includes a dot, which finally reaches a synchronized block causing this contention. More info here [1]. This is a Hibernate issue HHH-4959 that's fixed starting from 5.2.6 and HHH-11377 (5.2.7). --- [1] https://vladmihalcea.com/2016/12/14/the-performance-penalty-of-class-forname-when-parsing-jpql-and-criteria-queries/ [^] |
||
Revision | 2017-10-19 14:12 by alostale | ||
Description | With high concurrency contention at JVM level occurs when Hibernate is creating AST tree for queries at at org.hibernate.util.ReflectHelper.classForName(ReflectHelper.java:187) at org.hibernate.util.ReflectHelper.getConstantValue(ReflectHelper.java:266) This is caused because HQL allows to include Java constant values, to determine whether a token is or not a constant it performs a classForName whenever it includes a dot, which finally reaches a synchronized block causing this contention. More info [[https://vladmihalcea.com/2016/12/14/the-performance-penalty-of-class-forname-when-parsing-jpql-and-criteria-queries/ [^] |here]]. This is a Hibernate issue HHH-4959 that's fixed starting from 5.2.6 and HHH-11377 (5.2.7). |
||
Revision | 2017-10-19 14:09 by alostale | ||
Description | With high concurrency contention at JVM level occurs when Hibernate is creating AST tree for queries at at org.hibernate.util.ReflectHelper.classForName(ReflectHelper.java:187) at org.hibernate.util.ReflectHelper.getConstantValue(ReflectHelper.java:266) This is caused because HQL allows to include Java constant values, to determine whether a token is or not a constant it performs a classForName whenever it includes a dot, which finally reaches a synchronized block causing this contention. More info here [1]. This is a Hibernate issue HHH-4959 that's fixed starting from 5.2.6 and HHH-11377 (5.2.7). --- [1] https://vladmihalcea.com/2016/12/14/the-performance-penalty-of-class-forname-when-parsing-jpql-and-criteria-queries/ [^] |
||
Revision | 2017-10-19 14:07 by alostale | ||
Description | With high concurrency contention at JVM level occurs when Hibernate is creating AST tree for queries at at org.hibernate.util.ReflectHelper.classForName(ReflectHelper.java:187) at org.hibernate.util.ReflectHelper.getConstantValue(ReflectHelper.java:266) This is caused because HQL allows to include Java constant values, to determine whether a token is or not a constant it performs a classForName whenever it includes a dot, which finally reaches a synchronized block causing this contention. This is a Hibernate issue HHH-4959 that's fixed starting from 5.2.6 and HHH-11377 (5.2.7). |
||
Revision | 2017-10-19 13:12 by alostale | ||
Steps To Reproduce | Execute concurrently HQL queries, check there is contention at:java.lang.Thread.State: BLOCKED at org.apache.catalina.loader.WebappClassLoaderBase.loadClass(WebappClassLoaderBase.java:1200) - waiting to lock <334e3ea4> (a java.lang.Object) owned by "ajp-nio-8009-exec-46" t@125 at org.apache.catalina.loader.WebappClassLoaderBase.loadClass(WebappClassLoaderBase.java:1167) at org.hibernate.util.ReflectHelper.classForName(ReflectHelper.java:187) at org.hibernate.util.ReflectHelper.getConstantValue(ReflectHelper.java:266) at org.hibernate.hql.ast.QueryTranslatorImpl$JavaConstantConverter.handleDotStructure(QueryTranslatorImpl.java:599) at org.hibernate.hql.ast.QueryTranslatorImpl$JavaConstantConverter.visit(QueryTranslatorImpl.java:594) at org.hibernate.hql.ast.util.NodeTraverser.visitDepthFirst(NodeTraverser.java:78) at org.hibernate.hql.ast.util.NodeTraverser.traverseDepthFirst(NodeTraverser.java:66) at org.hibernate.hql.ast.QueryTranslatorImpl.parse(QueryTranslatorImpl.java:280) at org.hibernate.hql.ast.QueryTranslatorImpl.doCompile(QueryTranslatorImpl.java:182) - locked <56ccf607> (a org.hibernate.hql.ast.QueryTranslatorImpl) at org.hibernate.hql.ast.QueryTranslatorImpl.compile(QueryTranslatorImpl.java:136) at org.hibernate.engine.query.HQLQueryPlan.<init>(HQLQueryPlan.java:101) at org.hibernate.engine.query.HQLQueryPlan.<init>(HQLQueryPlan.java:80) at org.hibernate.engine.query.QueryPlanCache.getHQLQueryPlan(QueryPlanCache.java:124) at org.hibernate.impl.AbstractSessionImpl.getHQLQueryPlan(AbstractSessionImpl.java:156) at org.hibernate.impl.AbstractSessionImpl.createQuery(AbstractSessionImpl.java:135) at org.hibernate.impl.SessionImpl.createQuery(SessionImpl.java:1770) |
||
Revision | 2017-10-19 13:12 by alostale | ||
Description | With high concurrency contention at JVM level occurs when Hibernate is creating AST tree for queries at at org.hibernate.util.ReflectHelper.classForName(ReflectHelper.java:187) at org.hibernate.util.ReflectHelper.getConstantValue(ReflectHelper.java:266) This is caused because HQL allows to include Java constant values, to determine whether a token is or not a constant it performs a classForName which finally reaches a synchronized block causing this contention. This is a Hibernate issue HHH-4959 that's fixed starting from 5.2.6 and HHH-11377 (5.2.7). |
||
Revision | 2017-10-19 13:11 by alostale | ||
Steps To Reproduce | Execute concurrently HQL queries, check there is contention at: java.lang.Thread.State: BLOCKED at org.apache.catalina.loader.WebappClassLoaderBase.loadClass(WebappClassLoaderBase.java:1200) - waiting to lock <334e3ea4> (a java.lang.Object) owned by "ajp-nio-8009-exec-46" t@125 at org.apache.catalina.loader.WebappClassLoaderBase.loadClass(WebappClassLoaderBase.java:1167) at org.hibernate.util.ReflectHelper.classForName(ReflectHelper.java:187) at org.hibernate.util.ReflectHelper.getConstantValue(ReflectHelper.java:266) at org.hibernate.hql.ast.QueryTranslatorImpl$JavaConstantConverter.handleDotStructure(QueryTranslatorImpl.java:599) at org.hibernate.hql.ast.QueryTranslatorImpl$JavaConstantConverter.visit(QueryTranslatorImpl.java:594) at org.hibernate.hql.ast.util.NodeTraverser.visitDepthFirst(NodeTraverser.java:78) at org.hibernate.hql.ast.util.NodeTraverser.traverseDepthFirst(NodeTraverser.java:66) at org.hibernate.hql.ast.QueryTranslatorImpl.parse(QueryTranslatorImpl.java:280) at org.hibernate.hql.ast.QueryTranslatorImpl.doCompile(QueryTranslatorImpl.java:182) - locked <56ccf607> (a org.hibernate.hql.ast.QueryTranslatorImpl) at org.hibernate.hql.ast.QueryTranslatorImpl.compile(QueryTranslatorImpl.java:136) at org.hibernate.engine.query.HQLQueryPlan.<init>(HQLQueryPlan.java:101) at org.hibernate.engine.query.HQLQueryPlan.<init>(HQLQueryPlan.java:80) at org.hibernate.engine.query.QueryPlanCache.getHQLQueryPlan(QueryPlanCache.java:124) at org.hibernate.impl.AbstractSessionImpl.getHQLQueryPlan(AbstractSessionImpl.java:156) at org.hibernate.impl.AbstractSessionImpl.createQuery(AbstractSessionImpl.java:135) at org.hibernate.impl.SessionImpl.createQuery(SessionImpl.java:1770) |
||
Revision | 2017-10-19 13:11 by alostale | ||
Description | With high concurrency contention at JVM level occurs when Hibernate is creating AST tree for queries at at org.hibernate.util.ReflectHelper.classForName(ReflectHelper.java:187) at org.hibernate.util.ReflectHelper.getConstantValue(ReflectHelper.java:266) This is caused because HQL allows to include Java constant values, to determine whether a token is or not a constant it performs a classForName which finally reaches a synchronized block causing this contention. This is a Hibernate issue HHH-4959 that's fixed starting from 5.2.6 and HHH-11377 (5.2.7). |
Copyright © 2000 - 2009 MantisBT Group |